Jekyll's "--auto" doesn't work? - jekyll

I have just reinstalled my whole system and started working on my projects again. I used and still use Jekyll in some of them however I have a problem with auto generation using --auto or _config.yml's auto: true. It simply doesn't work. The output for jekyll --server --auto is:
Configuration from /home/rafal/Documents/Projects/ruby-adventure/_config.yml
Auto-regenerating enabled: /home/rafal/Documents/Projects/ruby-adventure -> /home/rafal/Documents/Projects/ruby-adventure/_site
[2013-03-23 19:09:53] regeneration: 1 files changed
[2013-03-23 19:09:53] INFO WEBrick 1.3.1
[2013-03-23 19:09:53] INFO ruby 2.0.0 (2013-02-24) [x86_64-linux]
[2013-03-23 19:09:53] WARN TCPServer Error: Address already in use - bind(2)
[2013-03-23 19:09:53] INFO WEBrick::HTTPServer#start: pid=3288 port=4000
[2013-03-23 19:09:53] regeneration: 1 files changed
[2013-03-23 19:09:54] regeneration: 1 files changed
[2013-03-23 19:09:54] regeneration: 1 files changed
[2013-03-23 19:09:54] regeneration: 1 files changed
[2013-03-23 19:09:54] regeneration: 1 files changed
[2013-03-23 19:09:54] regeneration: 1 files changed
[2013-03-23 19:09:54] regeneration: 1 files changed
The output from jekyll --no-auto --server is:
Configuration from /home/rafal/Documents/Projects/ruby-adventure/_config.yml
Building site: /home/rafal/Documents/Projects/ruby-adventure -> /home/rafal/Documents/Projects/ruby-adventure/_site
Successfully generated site: /home/rafal/Documents/Projects/ruby-adventure -> /home/rafal/Documents/Projects/ruby-adventure/_site
[2013-03-23 19:12:31] INFO WEBrick 1.3.1
[2013-03-23 19:12:31] INFO ruby 2.0.0 (2013-02-24) [x86_64-linux]
[2013-03-23 19:12:31] WARN TCPServer Error: Address already in use - bind(2)
[2013-03-23 19:12:31] INFO WEBrick::HTTPServer#start: pid=3327 port=4000
...so no error pops up. The site generates fine but when I change a file, it isn't auto regenerated. Any ideas why?

Seems to be caused by recent changes to the directory_watcher gem. Rolling the gem back fixed the issue for me:
sudo gem uninstall directory_watcher && sudo gem install directory_watcher -v 1.4.1

I was able to fix this by hard-locking the directory_watcher gem as per #lilakai, but I did it a different way:
Added this line to my gemfile (within the development group):
gem 'directory_watcher', '1.4'
And ran:
bundle update directory_watcher
Everything worked once I did this (as it locked my version to 1.4, which I confirmed via the Gemfile.lock). I prefer managing all of my gems directly through bundler as opposed to through system ruby.
I ran into this problem using the most recent version of Octopress (https://github.com/imathis/octopress) at the time of this post.

Related

Cannot Build the site on the preview server

I am a beginner on jekyll. I am following the documentation advice to Build the site on the preview server.
Here is what a did :
- install the last version of ruby
$ruby -v -> ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin16]
$ gem --version -> 2.6.14
- Install Jekyll
$gem install jekyll bundler -> Version of jekyll : jekyll-3.6.2
When I try to build the site on the preview server (bundle exec jekyll serve) there is the following error :
jekyll 3.6.2 | Error: (/Users/admin/Documents/Perso/Site-Internet/Jekyll/inger/_config.yml): did not find expected key while parsing a block mapping at line 16 column 1
the line 16 is the first line uncommented that shoul be processed. It is this one
title: Inger Hair at Home at Aix en Provence (line 16)
I don't see what can be wrong. Thank you in advance for your answers
Yaml files are sensitive to spaces, in your _config.yml you have:
# Exclude from processing.
# The following items will not be processed, by default. Create a custom list
# to override the default setting.
exclude:
- Gemfile
- Gemfile.lock
- node_modules
- vendor/bundle/
- vendor/cache/
- vendor/gems/
- vendor/ruby/
- Inger-Analytics-feb0aa8b73d1.json
- .gitignore
When it should be:
# Exclude from processing.
# The following items will not be processed, by default. Create a custom list
# to override the default setting.
exclude:
- Gemfile
- Gemfile.lock
- node_modules
- vendor/bundle/
- vendor/cache/
- vendor/gems/
- vendor/ruby/
- Inger-Analytics-feb0aa8b73d1.json
- .gitignore
Note the space before exclude:. Then it should work.

Rails5 jruby not able to start

Not able to start rails5 with jruby, getting the following error.
gavinyap#gavin-ubuntu  ~/Development/rails5app  rails s
DEPRECATION WARNING: alias_method_chain is deprecated. Please, use Module#prepend instead. From module, you can access the original method using super. (called from require at bin/rails:4)
Bundler::GemRequireError: There was an error while trying to load the gem 'activerecord-jdbcmysql-adapter'.
Gem Load Error is: uninitialized constant ActiveRecord::ConnectionAdapters::Column::Format
Backtrace for gem load error is:
/home/gavinyap/.rvm/gems/jruby-9.1.2.0/gems/activerecord-jdbc-adapter-1.3.20/lib/arjdbc/jdbc/type_cast.rb:13:in `<module:TypeCast>'
/home/gavinyap/.rvm/gems/jruby-9.1.2.0/gems/activerecord-jdbc-adapter-1.3.20/lib/arjdbc/jdbc/type_cast.rb:7:in `<module:Jdbc>'
/home/gavinyap/.rvm/gems/jruby-9.1.2.0/gems/activerecord-jdbc-adapter-1.3.20/lib/arjdbc/jdbc/type_cast.rb:4:in `< module:ConnectionAdapters>'
/home/gavinyap/.rvm/gems/jruby-9.1.2.0/gems/activerecord-jdbc-adapter-1.3.20/lib/arjdbc/jdbc/type_cast.rb:3:in `<top>'
/home/gavinyap/.rvm/gems/jruby-9.1.2.0/gems/activerecord-jdbc-adapter-1.3.20/lib/arjdbc/jdbc/column.rb:1:in `singleton cla
Versions of Jruby and Rails
jruby 9.1.2.0 (2.3.0) 2016-05-26 7357c8f
OpenJDK 64-Bit Server
VM 25.91-b14 on 1.8.0_91-8u91-b14-0ubuntu4~16.04.1-b14 +jit [linux-x86_64]
Rails 5.0.0
The ActiveRecord JDBC gem has not been updated for Rails 5. Checking the project in GitHub shows some development activity early this year but there is no indication when a new gem will be released for Rails 5.
add gem 'activerecord-jdbcmysql-adapter', '~> 5.0.pre1' to your gemfile

ejabberd 15.07: no sasl log file anymore

I compiled ejabberd 15.07 (make install, using a prefix for destination).
I am under Linux Mint 16 (based on Ubuntu 13.10) with the distro's erlang package (version R16B01).
I also tested on Ubuntu 12.04 using Erlang OTP 18.0 (erlang compiled myself and ejabberd compiled using --with-erlang, distro's packages are not installed).
ejabberd works perfectly fine in both environments except that the erlang.log file is not created, basically no erlang SASL logs at all.
I upgraded from distro's ejabberd v2.1.10 where that file used to contain a bunch of supervisor logs or component crash/restarts.
Looking at ejabberdctl script, it actually does set the sasl_error_logger file like it always did in the past (e.g. in versions 2.x).
If I do
gperrot#tristan ~/apps/ejabberd/sbin $ su -c 'erl -sasl sasl_error_logger \{file,\"/home/gperrot/apps/ejabberd/var/log/ejabberd/erlang.log\"\}'
Erlang R16B01 (erts-5.10.2) [source] [64-bit] [smp:4:4] [async-threads:10] [kernel-poll:false]
Eshell V5.10.2 (abort with ^G)
1> application:start(sasl).
ok
I can get a erlang.log file created with some content.
I used bash -x ejabberdctl start to check the command it uses:
sh -c '/usr/bin/erl -sname ejabberd#localhost -noinput -detached -pa /home/gperrot/apps/ejabberd/lib/ejabberd/ebin -mnesia dir "\"/home/gperrot/apps/ejabberd/var/lib/ejabberd\"" -ejabberd log_rate_limit 100 log_rotate_size 10485760 log_rotate_count 1 log_rotate_date '\''""'\'' -s ejabberd -sasl sasl_error_logger \{file,\"/home/gperrot/apps/ejabberd/var/log/ejabberd/erlang.log\"\} +K true -smp auto +P 250000 start ""'
File path is set properly, same user running, same file permissions.
I don't understand why I get no erlang.log file managed by ejabberd.
SASL is correctly started:
gperrot#tristan ~/apps/ejabberd/sbin $ ejabberdctl debug
(ejabberd#localhost)1> application:start(sasl).
{error,{already_started,sasl}}
And in ejabberd.log I also get
2015-09-04 17:29:51.252 [info] <0.7.0> Application sasl started on node ejabberd#localhost
But not erlang.log file.
Any idea why?

Error on launching a local version of a website

I tried to install Jekyll On Windows 7. I followed this guide http://www.testically.org/2012/02/02/installing-jekyll-and-ruby-on-windows/
So I first downloaded Ruby and added \;C:\Ruby193\bin to the path variable.
I then downloaded DevKit and added \;C:\Users\jimmy\Downloads\teeheeband\bin\ to the path variable as well.
I then opened my command and did the following (in order)
cd ;C:\Users\jimmy\Downloads\teeheeband
ruby dk.rb init
ruby dk.rb install
the following are the codes that appeared on my screen when I did the above steps.
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\jimmy>cd ;C:\Users\jimmy\Downloads\teeheeband
C:\Users\jimmy\Downloads\teeheeband>ruby dk.rb init
[INFO] found RubyInstaller v1.9.3 at C:/Ruby193
Initialization complete! Please review and modify the auto-generated
'config.yml' file to ensure it contains the root directories to all
of the installed Rubies you want enhanced by the DevKit.
C:\Users\jimmy\Downloads\teeheeband>ruby dk.rb install
[INFO] Skipping existing gem override for 'C:/Ruby193'
[WARN] Skipping existing DevKit helper library for 'C:/Ruby193'
C:\Users\jimmy\Downloads\teeheeband>gem install jekyll
Successfully installed jekyll-0.12.0
1 gem installed
Installing ri documentation for jekyll-0.12.0...
Installing RDoc documentation for jekyll-0.12.0...
C:\Users\jimmy\Downloads\teeheeband>
Once I did the above, I downloaded github and cloned the repo that I wanted to work on. I then went to Gitshell and did the following
Windows PowerShell
Copyright (C) 2009 Microsoft Corporation. All rights reserved.
C:\Users\jimmy\Documents\GitHub> cd prog694.github.com
C:\Users\jimmy\Documents\GitHub\prog694.github.com [new-branch]> jekyll --server
--auto
Configuration from C:/Users/jimmy/Documents/GitHub/prog694.github.com/_config.ym
l
Auto-regenerating enabled: C:/Users/jimmy/Documents/GitHub/prog694.github.com ->
C:/Users/jimmy/Documents/GitHub/prog694.github.com/_site
[2013-02-03 20:19:00] regeneration: 402 files changed
[2013-02-03 20:19:01] INFO WEBrick 1.3.1
[2013-02-03 20:19:01] INFO ruby 1.9.3 (2013-01-15) [i386-mingw32]
[2013-02-03 20:19:01] INFO WEBrick::HTTPServer#start: pid=4036 port=4000
[2013-02-03 20:20:24] ERROR no access permission to `/'
jimmy-PC - - [03/Feb/2013:20:20:24 Atlantic Standard Time] "GET / HTTP/1.1" 403
283
- -> /
[2013-02-03 20:20:24] ERROR `/favicon.ico' not found.
jimmy-PC - - [03/Feb/2013:20:20:24 Atlantic Standard Time] "GET /favicon.ico HTT
P/1.1" 404 281
- -> /favicon.ico
Finally I opened a browser and tried to run a local copy of the website via : localhost:4000
I failed and got this message
Forbidden
no access permission to `/'
WEBrick/1.3.1 (Ruby/1.9.3/2013-01-15) at 127.0.0.1:4000
so I used h**p://127.0.0.1:4000/( replace t with **)
failed again
Forbidden
no access permission to `/'
WEBrick/1.3.1 (Ruby/1.9.3/2013-01-15) at 127.0.0.1:4000
All I want is to be able to open and run a local version of this website. Any help would be greatly appreciated.
Check if your port 4000 is not used by something else, or if you have a firewall enable access to it.
I'd highly disrecomend Windows for jekyll (or any ruby gem/app), installing and using it in Linux would be much easier.

Installation error for DBD::MySQL on OSX v10.6.6

I'm attempting to get DBD::MySQL working on Snow Leopard (v10.6.6). The default version of Perl that comes with the OS is v5.10.0. Since I've read that's 64-bit, I went ahead and downloaded and installed a 64-bit version of MySQL (mysql-5.5.8-osx10.6-x86_64).
Installing and setting up MySQL went smoothly, here's my config and version number for reference.
I used CPAN to download DBI and the DBD::MySQL drivers. I then:
Installed DBI
Setup a Makefile.PL
Ran the make command from the command line
The Makefile.PL said it would use the following settings for compiling and testing:
I will use the following settings for compiling and testing:
cflags (mysql_config ) = -I/usr/local/mysql/include -Os -g -fno-common -fno-strict-aliasing -arch x86_64
embedded (mysql_config ) =
libs (mysql_config ) = -L/usr/local/mysql/lib -lmysqlclient -lpthread
mysql_config (guessed ) = mysql_config
nocatchstderr (default ) = 0
nofoundrows (default ) = 0
ssl (guessed ) = 0
testdb (default ) = test
testhost (default ) =
testpassword (User's choice) = r00t!
testsocket (default ) =
testuser (User's choice) = root
To change these settings, see 'perl Makefile.PL --help' and
'perldoc INSTALL'.
Multiple copies of Driver.xst found in: /Library/Perl/5.10.0/darwin-thread-multi-2level/auto/DBI/ /System/Library/Perl/Extras/5.10.0/darwin-thread-multi-2level/auto/DBI/ at Makefile.PL line 907
Using DBI 1.616 (for perl 5.010000 on darwin-thread-multi-2level) installed in /Library/Perl/5.10.0/darwin-thread-multi-2level/auto/DBI/
Writing Makefile for DBD::mysql
Everything seemed to be going fine, until I tried to run make test :
t/00base....................NOK 2/6# Tried to use 'DBD::mysql'.
# Error: Can't load '/Users/swm/.cpan/build/DBD-mysql-4.018-Pnd2qz/blib/arch/auto/DBD/mysql/mysql.bundle' for module DBD::mysql: dlopen(/Users/swm/.cpan/build/DBD-mysql-4.018-Pnd2qz/blib/arch/auto/DBD/mysql/mysql.bundle, 2): Library not loaded: libmysqlclient.16.dylib
# Referenced from: /Users/swm/.cpan/build/DBD-mysql-4.018-Pnd2qz/blib/arch/auto/DBD/mysql/mysql.bundle
# Reason: image not found at /System/Library/Perl/5.10.0/darwin-thread-multi-2level/DynaLoader.pm line 207.
# at (eval 7) line 2
# Compilation failed in require at (eval 7) line 2.
# BEGIN failed--compilation aborted at (eval 7) line 2.
FAILED--Further testing stopped: Unable to load DBD::mysql
make: *** [test_dynamic] Error 9
It's failing because it can't seem to find the mysql.bundle for DBD. Has anyone come across this problem? Or can point me in the right direction on what to try next? I need DBI/DBD::MySQL for my new job and I'm scrambling to find a solution.
Many thanks in advance.
I got around the "Library not loaded: libmysqlclient.16.dylib" problem by placing a symbolic link in /usr/lib/" to /usr/local/mysql-5.5.8-osx10.6-x86_64/lib/libmysqlclient.16.dylib
I worked around the same or a similar issue. Somehow I could build and test DBD::mysql with cpan but when I tried to use it in a script it said things like
dyld: lazy symbol binding failed: Symbol not found: _mysql_init
Referenced from: /Library/Perl/5.10.0/darwin-thread-multi-2level/auto/DBD/mysql/mysql.bundle
Expected in: flat namespace
Apparently, it's a 64-bit vs 32-bit issue.
Installing the fink dbd-mysql-pm5100 package made it work though it took kind of a long time. I also removed the cpan-installed version:
sudo rm -rf /Library/Perl/5.10.0/darwin-thread-multi-2level/auto/DBD/mysql
sudo rm -rf /Library/Perl/5.10.0/darwin-thread-multi-2level/DBD/mysql
sudo rm -rf /Library/Perl/5.10.0/darwin-thread-multi-2level/DBD/mysql.pm
also include in .profile
export VERSIONER_PERL_PREFER_32_BIT=yes;
Besides creating the link the executions of the program with DBI::mysql generated an error, thus including this variable on the environment make it works
I know this is an old post. But I suppose the best solution would be to add the library directory to the DYLD_FALLBACK_LIBRARY_PATH env variable. (reason here: https://stackoverflow.com/a/3172515/119958 )
There is no ldconfig in mac, so just add the path to this env var and rerun the install process for DBD::mysql
Donato-Vianas-MacBook-Pro:Invoicer donato$ cpanm DBD::mysql
--> Working on DBD::mysql
Fetching http://www.cpan.org/authors/id/C/CA/CAPTTOFU/DBD-mysql-4.022.tar.gz ... OK
Configuring DBD-mysql-4.022 ... OK
Building and testing DBD-mysql-4.022 ... FAIL
! Installing DBD::mysql failed. See /Users/donato/.cpanm/build.log for details.
# Failed test 'use DBD::mysql;'
# at t/00base.t line 21.
# Tried to use 'DBD::mysql'.
# Error: Can't load '/Users/donato/.cpanm/work/1359948144.491/DBD-mysql-4.022/blib/arch/auto/DBD/mysql/mysql.bundle' for module DBD::mysql: dlopen(/Users/donato/.cpanm/work/1359948144.491/DBD-mysql-4.022/blib/arch/auto/DBD/mysql/mysql.bundle, 2): Library not loaded: libmysqlclient.18.dylib
Donato-Vianas-MacBook-Pro:Invoicer donato$ export DYLD_FALLBACK_LIBRARY_PATH=/usr/local/mysql/lib/:$DYLD_FALLBACK_LIBRARY_PATH
Donato-Vianas-MacBook-Pro:Invoicer donato$ cpanm DBD::mysql--> Working on DBD::mysql
Fetching http://www.cpan.org/authors/id/C/CA/CAPTTOFU/DBD-mysql-4.022.tar.gz ... OK
Configuring DBD-mysql-4.022 ... OK
Building and testing DBD-mysql-4.022 ... OK
Successfully installed DBD-mysql-4.022
1 distribution installed
Donato's solution works for install, but the var has to be present at runtime as well or I get the same error. The following fixes this at runtime for shell and _www user:
# For command line use, add following line to ~/.bash_profile:
export DYLD_FALLBACK_LIBRARY_PATH=/usr/local/mysql/lib/:$DYLD_FALLBACK_LIBRARY_PATH
# If Apache needs it, add following line to /etc/apache2/httpd.conf:
# On Lion Server, I put it after <IfDefine MACOSXSERVER>, but shouldn't matter
SetEnv DYLD_FALLBACK_LIBRARY_PATH /usr/local/mysql/lib/:$DYLD_FALLBACK_LIBRARY_PATH
It's somewhat of an aside, but I strongly recommend setting up a separate perl on the machine -- either by fink / macports, or from source -- and leaving the Mac's system perl (and its libraries) alone.
Once I did this on my own Mac, I had very few troubles installing modules thereafter, and I didn't have to worry about accidentally blowing a hole in my OS by breaking the perl that the system uses.
If it were my Mac, I'd install a new perl from source (the Perl source distribution is smart enough to install itself see that it's on a Mac and install itself safely into /usr/local/bin) and the proceed from thee to install DBD::Mysql (and the other modules you require).