eze#eze:~/Appp$ rbenv local
rbenv: no local version configured for this directory
eze#eze:~/Appp$ rbenv global
2.2.1
eze#eze:~/Appp$ rbenv versions
* 2.2.1 (set by /home/eze/.rbenv/version)
I recently uninstalled and reinstalled ruby with rbenv, but when I installed again I realized that everything worked except from the rails console, this is the output error
/home/eze/.rbenv/versions/2.2.1/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- set (LoadError) from /home/eze/.rbenv/versions/2.2.1/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require' from /var/lib/gems/1.9.1/gems/bundler-1.6.5/lib/bundler/index.rb:1:in
`<top (required)>' from /var/lib/gems/1.9.1/gems/bundler-1.6.5/lib/bundler/source/rubygems.rb:204:in `fetch_specs' from /var/lib/gems/1.9.1/gems/bundler-1.6.5/lib/bundler/source/rubygems.rb:66:in `specs' from /var/lib/gems/1.9.1/gems/bundler-1.6.5/lib/bundler/lazy_specification.rb:53:in
`__materialize__' from /var/lib/gems/1.9.1/gems/bundler-1.6.5/lib/bundler/spec_set.rb:88:in `block in materialize' from /var/lib/gems/1.9.1/gems/bundler-1.6.5/lib/bundler/spec_set.rb:85:in `map!' from /var/lib/gems/1.9.1/gems/bundler-1.6.5/lib/bundler/spec_set.rb:85:in
`materialize' from /var/lib/gems/1.9.1/gems/bundler-1.6.5/lib/bundler/definition.rb:133:in `specs' from /var/lib/gems/1.9.1/gems/bundler-1.6.5/lib/bundler/definition.rb:178:in `specs_for' from /var/lib/gems/1.9.1/gems/bundler-1.6.5/lib/bundler/definition.rb:167:in
`requested_specs' from /var/lib/gems/1.9.1/gems/bundler-1.6.5/lib/bundler/environment.rb:18:in `requested_specs' from /var/lib/gems/1.9.1/gems/bundler-1.6.5/lib/bundler/runtime.rb:13:in `setup' from /var/lib/gems/1.9.1/gems/bundler-1.6.5/lib/bundler.rb:120:in
`setup' from /var/lib/gems/1.9.1/gems/bundler-1.6.5/lib/bundler/setup.rb:7:in `
<top (required)>' from /home/eze/.rbenv/versions/2.2.1/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `require' from /home/eze/.rbenv/versions/2.2.1/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `rescue in require' from /home/eze/.rbenv/versions/2.2.1/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:39:in
`require' from /var/lib/gems/1.9.1/gems/spring-1.3.3/lib/spring/commands.rb:33:in `
<module:Spring>' from /var/lib/gems/1.9.1/gems/spring-1.3.3/lib/spring/commands.rb:4:in `
<top (required)>' from /home/eze/.rbenv/versions/2.2.1/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require' from /home/eze/.rbenv/versions/2.2.1/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require' from /var/lib/gems/1.9.1/gems/spring-1.3.3/lib/spring/server.rb:9:in
`
<top (required)>' from /home/eze/.rbenv/versions/2.2.1/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `require' from /home/eze/.rbenv/versions/2.2.1/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `rescue in require' from /home/eze/.rbenv/versions/2.2.1/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:39:in
`require'
Solution:
Do gem update --system. It appears that you hadn't installed an updated version of rubygems to go with your new version of Ruby.
Sorry I took so long to get to a solution that worked for you, it seems more obvious now. :)
Original Answer:
Have you made sure that the global (or possibly local, if you have one set) Ruby version is set correctly with rbenv? Have you tried doing rbenv rehash.
It looks like you're missing the Set module in the Ruby standard library for some reason- but since I believe it is part of the standard library and should be there unless your Ruby installation is somehow broken, it makes me wonder if the shims installed by rbenv might be pointing at the wrong place. rbenv rehash should fix that problem, I believe, if that is the cause.
Otherwise, is there any more information about your environment you can give? Such as the output of
rbenv local
rbenv global
rbenv versions
Also, how are you starting the rails console?
Are you doing rails console in your project's directory?
If you start irb and then do require 'set', does it work, or does it throw an error?
Related
I don't seem to be able to get compass working on Vagrant using this Vagrantfile. See the rest of the bash script's used right here(removed repo) (see Vaprobash if you want to provision your Vagrant Ubuntu Box!).
So I was fallowing a gruntjs course, when I had to use grunt server. The only problem is that it needs a newer ruby version (1.9+ I believe instead of the 1.8) and it needs compass. So I have solved the ruby part by installing RVM and installing the latest stable version. Compass should be easy to get gem install compass and it does seem to be installed. But when I type in compass -v I get the fallowing error:
/home/vagrant/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- sass/script/node (LoadError)
from /home/vagrant/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/vagrant/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches/browser_support.rb:1:in `<top (required)>'
from /home/vagrant/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/vagrant/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/vagrant/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches.rb:2:in `block in <top (required)>'
from /home/vagrant/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches.rb:1:in `each'
from /home/vagrant/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches.rb:1:in `<top (required)>'
from /home/vagrant/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/vagrant/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/vagrant/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/lib/compass/sass_extensions.rb:9:in `<top (required)>'
from /home/vagrant/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/vagrant/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/vagrant/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/lib/compass.rb:5:in `block in <top (required)>'
from /home/vagrant/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/lib/compass.rb:4:in `each'
from /home/vagrant/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/lib/compass.rb:4:in `<top (required)>'
from /home/vagrant/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/vagrant/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/vagrant/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/bin/compass:20:in `block in <top (required)>'
from /home/vagrant/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/bin/compass:8:in `fallback_load_path'
from /home/vagrant/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/bin/compass:19:in `<top (required)>'
from /home/vagrant/.rvm/gems/ruby-2.1.0/bin/compass:23:in `load'
from /home/vagrant/.rvm/gems/ruby-2.1.0/bin/compass:23:in `<main>'
from /home/vagrant/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `eval'
from /home/vagrant/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `<main>'
So I am not sure what is going wrong except for the error telling me it's missing files. Anyone got some hints to what could be the problem?
.bash_profile contains the path info:
[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
rvm -v and ruby -v work just fine and after installing gem install compass sass -v seem to work as well.
You can replicate everything using Vagrant and VirtualBox. Just download the Vagrantfile from my github mentioned above and vagrant up.
I asked for help on the official compass Github issue's page and got the answer for this problem.
The GitHub issue is right here.
How to fix this:
When installing compass (v0.12.2), it will download the latest sass v3.3.0.rc3 (cause it's a dependency), but compass won't work with the latest sass. You either upgrade compass to the latest alpha version (0.13.*) or downgrade sass to 3.2.*. I choose the last one:
gem uninstall sass --version 3.3.0.rc.3
gem install sass --version 3.2.18
compass -v # Working :)
Make sure you use the version you got installed. Find out by typing this:
sass --version
have a look at this answer https://stackoverflow.com/a/21082978/497756 - it was for other problem but should solve yours too.
Just recently skanked my PC, and I've not used Jekyll in a while, or indeed Ruby, however after thinking I'd set up everything correctly, when I try and run...
jekyll build or
jekyll serve
I get this error:
Generating... Liquid Exception: cannot load such file -- yajl/2.0/yajl i
n _posts/2013-09-21-welcome-to-jekyll.markdown
C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:53:in `require': c
annot load such file -- yajl/2.0/yajl (LoadError)
from C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:53:in
`require'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/yajl-ruby-1.1.0-x86-mingw32/lib
/yajl/yajl.rb:2:in `<top (required)>'
from C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:53:in
`require'
from C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:53:in
`require'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/yajl-ruby-1.1.0-x86-mingw32/lib
/yajl.rb:1:in `<top (required)>'
from C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:118:i
n `require'
from C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:118:i
n `rescue in require'
from C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:124:i
n `require'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/pygments.rb-0.5.4/lib/pygments/
popen.rb:3:in `<top (required)>'
from C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:114:i
n `require'
from C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:114:i
n `require'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/pygments.rb-0.5.4/lib/pygments.
rb:1:in `<top (required)>'
from C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:66:in
`require'
from C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:66:in
`require'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/jekyll-1.3.1/lib/jekyll/tags/hi
ghlight.rb:52:in `render_pygments'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/jekyll-1.3.1/lib/jekyll/tags/hi
ghlight.rb:45:in `render'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/liquid-2.5.4/lib/liquid/block.r
b:106:in `block in render_all'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/liquid-2.5.4/lib/liquid/block.r
b:93:in `each'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/liquid-2.5.4/lib/liquid/block.r
b:93:in `render_all'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/liquid-2.5.4/lib/liquid/block.r
b:82:in `render'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/liquid-2.5.4/lib/liquid/templat
e.rb:124:in `render'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/liquid-2.5.4/lib/liquid/templat
e.rb:132:in `render!'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/jekyll-1.3.1/lib/jekyll/convert
ible.rb:88:in `render_liquid'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/jekyll-1.3.1/lib/jekyll/convert
ible.rb:150:in `do_layout'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/jekyll-1.3.1/lib/jekyll/post.rb
:259:in `render'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/jekyll-1.3.1/lib/jekyll/site.rb
:241:in `block in render'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/jekyll-1.3.1/lib/jekyll/site.rb
:240:in `each'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/jekyll-1.3.1/lib/jekyll/site.rb
:240:in `render'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/jekyll-1.3.1/lib/jekyll/site.rb
:39:in `process'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/jekyll-1.3.1/lib/jekyll/command
.rb:18:in `process_site'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/jekyll-1.3.1/lib/jekyll/command
s/build.rb:23:in `build'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/jekyll-1.3.1/lib/jekyll/command
s/build.rb:7:in `process'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/jekyll-1.3.1/bin/jekyll:77:in `
block (2 levels) in <top (required)>'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/commander-4.1.5/lib/commander/c
ommand.rb:180:in `call'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/commander-4.1.5/lib/commander/c
ommand.rb:180:in `call'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/commander-4.1.5/lib/commander/c
ommand.rb:155:in `run'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/commander-4.1.5/lib/commander/r
unner.rb:402:in `run_active_command'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/commander-4.1.5/lib/commander/r
unner.rb:66:in `run!'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/commander-4.1.5/lib/commander/d
elegates.rb:7:in `run!'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/commander-4.1.5/lib/commander/i
mport.rb:10:in `block in <top (required)>'
I think it's related to pygments.rb somehow. If i remove the first post that has the syntax highlighting demo, the build works. I've attemped to update pgyments to 0.5.4 but this seemed to make no different. I think got an error that pygments.rb is locked to 0.3.4:
Fetching gem metadata from https://rubygems.org/.......
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
You have requested:
pygments.rb ~> 0.5.4
The bundle currently has pygments.rb locked at 0.3.7.
Try running `bundle update pygments.rb`
Can anyone shed any light on this? It's driving me nuts. Running Ruby 2.0.0p353.
I did following
gem install rouge
and then
added following line in the _config.yml
highlighter: rouge
I found this solution from following page's last comment
https://github.com/jekyll/jekyll-help/issues/50
I encountered a similar problem today when trying to setup Octopress/Jekyll.
Here is the solution I found.
Step 1
Go to your ruby gems directory.
In my case it's located at C:/Ruby21/lib/ruby/gems/2.1.0/gems
Look for yajl.
You will see a folder called yajl-ruby-1.1.0-x86-mingw32
You may or may not see one called yajl-ruby-1.2.1
The one with a -ruby-1.1.0-x86-mingw32 tail is the default. And leads to the error.
What we want to use is the other version
Step 2
If you do not have the none mingw32 version, run
gem install yajl-ruby
This will install the latest version.
In my case the latest version was 1.2.1
Step 3
Change the default from the mingw32 version to the current version.
To do so, go to your website's gemfile.lock file
Find the line that says yajl-ruby (1.1.0-x86-mingw32)
and change it to yajl-ruby (1.2.1)
or the respective version you downloaded
Step 4
That's it. It should work now.
Yajl itself is a “small event-driven (SAX-style) JSON parser written in ANSI C.” You are supposed to install it on your Windows box (I’m not sure if there are binary downloads available, possibly you are to download sources and compile them with your preferred C compiler) before trying to install yajl-ruby gem, which is simply the binding to it.
Another option is to install Ruby development kit, refer to this manual for detailed explanation.
I thought I had Compass installed OK using rbenv on my Mac, but I got an error when trying to switch Codekit to use it instead of its internal compiler.
Running compass -v in the terminal gives me:
/.rbenv/versions/1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:110:in `require': cannot load such file -- sass/script/node (LoadError)
from /.rbenv/versions/1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:110:in `rescue in require'
from /.rbenv/versions/1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:35:in `require'
from /.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches/browser_support.rb:1:in `<top (required)>'
from /.rbenv/versions/1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:58:in `require'
from /.rbenv/versions/1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:58:in `require'
from /.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches.rb:2:in `block in <top (required)>'
from /.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches.rb:1:in `each'
from /.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches.rb:1:in `<top (required)>'
from /.rbenv/versions/1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:58:in `require'
from /.rbenv/versions/1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:58:in `require'
from /.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/compass-0.12.2/lib/compass/sass_extensions.rb:9:in `<top (required)>'
from /.rbenv/versions/1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:58:in `require'
from /.rbenv/versions/1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:58:in `require'
from /.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/compass-0.12.2/lib/compass.rb:5:in `block in <top (required)>'
from /.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/compass-0.12.2/lib/compass.rb:4:in `each'
from /.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/compass-0.12.2/lib/compass.rb:4:in `<top (required)>'
from /.rbenv/versions/1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:58:in `require'
from /.rbenv/versions/1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:58:in `require'
from /.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/compass-0.12.2/bin/compass:20:in `block in <top (required)>'
from /.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/compass-0.12.2/bin/compass:8:in `fallback_load_path'
from /.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/compass-0.12.2/bin/compass:19:in `<top (required)>'
from /.rbenv/versions/1.9.3-p392/bin/compass:23:in `load'
from /.rbenv/versions/1.9.3-p392/bin/compass:23:in `<main>'
So, it would seem there's a problem there, although running gem install compass tells me that compass-0.12.2 was successfully installed.
How do I go about working out what the problem is and fixing it?
Try this version,
http://rubygems.org/gems/sass/versions/3.3.0.alpha.149
gem install sass -v 3.3.0.alpha.149 --pre
Bear in mind that the command above installs the gem, it doesn't activate the version!
You can run the following:
gem uninstall sass
You'll be prompted with a list of installed versions; merely uninstall the ones that are 3.3.0.alpha.X where X is higher then 149.
You can test it works via:
sass --version
compass --version
You should see normal pages (instead of the errors in your question).
ps.
You may need this too:
gem install compass-sourcemaps -v 0.12.2.sourcemaps.57a186c --pre
In my case, it was an incompatibility between compass and sass. It was "sass-3.3.0.rc.2" installed automatically via compass dependencies.
So I had to remove sass version gem uninstall sass and install another version gem install sass -v 3.2.12
After that, the errors disappeared.
There's an issue with some imports in one script within compass. An easy fix, but for now you can add this to your Gemfile (works for me right now):
gem "compass", github: 'ovaskevich/compass'
I am trying to get Jekyll working on Windows and am having no luck. This is the first time I've installed/used Ruby.
Ruby version: ruby 2.0.0p0 (2013-02-24) [i386-mingw32] (http://rubyinstaller.org/)
Jekyll version: jekyll 1.0.1
The error goes away when I set pygments to false in _config.yml.
Error message
D:\Code\Jekyll\test>jekyll serve
Configuration file: D:/Code/Jekyll/test/_config.yml
Source: D:/Code/Jekyll/test
Destination: D:/Code/Jekyll/test/_site
Generating... Liquid Exception: cannot load such file -- yajl/2.0/yajl in 2013-05-11-welcome-to-jekyll.markdown
C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/yajl-ruby-1.1.0-x86-mingw32/lib/yajl/yajl.rb:2:in `<top (required)>'
C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/yajl-ruby-1.1.0-x86-mingw32/lib/yajl.rb:1:in `<top (required)>'
C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/pygments.rb-0.4.2/lib/pygments/popen.rb:3:in `<top (required)>'
C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/pygments.rb-0.4.2/lib/pygments.rb:1:in `<top (required)>'
C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/jekyll-1.0.1/lib/jekyll/tags/highlight.rb:52:in `render_pygments'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/jekyll-1.0.1/lib/jekyll/tags/highlight.rb:45:in `render'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/liquid-2.5.0/lib/liquid/block.rb:106:in `block in render_all'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/liquid-2.5.0/lib/liquid/block.rb:93:in `each'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/liquid-2.5.0/lib/liquid/block.rb:93:in `render_all'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/liquid-2.5.0/lib/liquid/block.rb:82:in `render'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/liquid-2.5.0/lib/liquid/template.rb:124:in `render'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/liquid-2.5.0/lib/liquid/template.rb:132:in `render!'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/jekyll-1.0.1/lib/jekyll/convertible.rb:77:in `render_liquid'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/jekyll-1.0.1/lib/jekyll/convertible.rb:128:in `do_layout'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/jekyll-1.0.1/lib/jekyll/post.rb:285:in `render'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/jekyll-1.0.1/lib/jekyll/site.rb:230:in `block in render'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/jekyll-1.0.1/lib/jekyll/site.rb:229:in `each'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/jekyll-1.0.1/lib/jekyll/site.rb:229:in `render'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/jekyll-1.0.1/lib/jekyll/site.rb:44:in `process'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/jekyll-1.0.1/lib/jekyll/command.rb:18:in `process_site'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/jekyll-1.0.1/lib/jekyll/commands/build.rb:23:in `build'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/jekyll-1.0.1/lib/jekyll/commands/build.rb:7:in `process'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/jekyll-1.0.1/bin/jekyll:83:in `block (2 levels) in <top (required)>'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/commander-4.1.3/lib/commander/command.rb:180:in `call'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/commander-4.1.3/lib/commander/command.rb:180:in `call'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/commander-4.1.3/lib/commander/command.rb:155:in `run'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/commander-4.1.3/lib/commander/runner.rb:402:in `run_active_command'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/commander-4.1.3/lib/commander/runner.rb:66:in `run!'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/commander-4.1.3/lib/commander/delegates.rb:7:in `run!'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/commander-4.1.3/lib/commander/import.rb:10:in `block in <top (required)>'
Build Failed
I did following
gem install rouge
and then
added following line in the _config.yml
highlighter: rouge
I found this solution from following page's comment thread
https://github.com/jekyll/jekyll-help/issues/50
The problem was as #scriptin mentioned in the comments.
I installed ruby v 1.9.3 instead and it solved my problem.
simply add the following line in the _config.yml
highlighter: false
Now browse to localhost:4000
I encountered a similar problem today when trying to setup Octopress/Jekyll.
Here is the solution I found.
Step 1
Go to your ruby gems directory.
In my case it's located at C:/Ruby21/lib/ruby/gems/2.1.0/gems
Look for yajl.
You will see a folder called yajl-ruby-1.1.0-x86-mingw32
You may or may not see one called yajl-ruby-1.2.1
The one with a -ruby-1.1.0-x86-mingw32 tail is the default. And leads to the error.
What we want to use is the other version
Step 2
If you do not have the none mingw32 version, run
gem install yajl-ruby
This will install the latest version.
In my case the latest version was 1.2.1
Step 3
Change the default from the mingw32 version to the current version.
To do so, go to your website's gemfile.lock file
Find the line that says yajl-ruby (1.1.0-x86-mingw32)
and change it to yajl-ruby (1.2.1)
or the respective version you downloaded
Step 4
That's it. It should work now.
You can work round it by manually editing the file that is giving the error to look like this.
RUBY_VERSION =~ /(\d+.\d+)/
require "yajl"
The other proposed solutions appear to either turn off code highlighting, or set it to use Rouge instead of Pygments. I need to use Pygments due to its greater language support.
As described in https://github.com/brianmario/yajl-ruby/issues/116, this issue happens because the precompiled yajl will not work with Ruby 2.0. It needs to be compiled. To make this work so that you can use pygments:
Uninstall the precompiled yajl-ruby gem.
Install it using the syntax shown in that github thread. Note that you may need to specify the version. In my case, Jekyll specifically wanted 1.1.0, so I installed using this syntax:
gem install yajl-ruby --platform=ruby --version=1.1.0
After doing this, Jekyll worked without disabling code highlighting or switching to Rouge.
Install Yajl 1.2.0. Seems to be a bug with 1.2.1.
gem install yajl-ruby --version=1.2.0 --platform=ruby
problem solved.
I'm not sure if the platform part is important like others believe, but this worked for me.
I tried to getting started with chef so I installed the chef gem on my laptop ( OS : OSX 10.8) with ruby 2.0.0-p0 but when I try to "knife configure " I juste get this message :
/Users/maximeheckel/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:106:in `require': cannot load such file -- rubygems/format (LoadError)
from /Users/maximeheckel/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:106:in `require'
from /Users/maximeheckel/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/chef-11.4.0/lib/chef/provider/package/rubygems.rb:34:in `<top (required)>'
from /Users/maximeheckel/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:58:in `require'
from /Users/maximeheckel/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:58:in `require'
from /Users/maximeheckel/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/chef-11.4.0/lib/chef/providers.rb:60:in `<top (required)>'
from /Users/maximeheckel/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:58:in `require'
from /Users/maximeheckel/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:58:in `require'
from /Users/maximeheckel/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/chef-11.4.0/lib/chef.rb:25:in `<top (required)>'
from /Users/maximeheckel/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:58:in `require'
from /Users/maximeheckel/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:58:in `require'
from /Users/maximeheckel/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/chefspec-0.9.0/lib/chefspec.rb:1:in `<top (required)>'
from /Users/maximeheckel/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:110:in `require'
from /Users/maximeheckel/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:110:in `rescue in require'
from /Users/maximeheckel/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:35:in `require'
from /Users/maximeheckel/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/chefspec-0.9.0/lib/chef/knife/cookbook_create_specs.rb:1:in `<top (required)>'
from /Users/maximeheckel/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/chef-11.4.0/lib/chef/knife/core/subcommand_loader.rb:37:in `load'
from /Users/maximeheckel/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/chef-11.4.0/lib/chef/knife/core/subcommand_loader.rb:37:in `block in load_commands'
from /Users/maximeheckel/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/chef-11.4.0/lib/chef/knife/core/subcommand_loader.rb:37:in `each'
from /Users/maximeheckel/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/chef-11.4.0/lib/chef/knife/core/subcommand_loader.rb:37:in `load_commands'
from /Users/maximeheckel/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/chef-11.4.0/lib/chef/knife.rb:119:in `load_commands'
from /Users/maximeheckel/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/chef-11.4.0/lib/chef/knife.rb:167:in `run'
from /Users/maximeheckel/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/chef-11.4.0/lib/chef/application/knife.rb:123:in `run'
from /Users/maximeheckel/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/chef-11.4.0/bin/knife:25:in `<top (required)>'
from /Users/maximeheckel/.rbenv/versions/2.0.0-p0/bin/knife:23:in `load'
from /Users/maximeheckel/.rbenv/versions/2.0.0-p0/bin/knife:23:in `<main>'
The accepted answer isn't entirely correct. The problem isn't ruby 2.0, it's rubygems 2.x. If you run gem update --system 1.8.25 to downgrade to a pre 2.x rubygems, everything works like a champ.
NOTE: I haven't had to do this locally, but this is how I've gotten knife bootstrap to work against my remote servers. I'm running ruby 2.0 on my local machine with latest rubygems and chef 11.4.4 and everything else seems to work properly.
According to this issue at opscode it was a bug. It has been fixed in chef 11.6.0.
The problem is that only chef 11.4.4 is on rubygems as of today (2013-06-23)
So, either use 1.9.x or rubygems 1.8.25 will work for now, until the next version of chef comes out. It may be possible to build it from https://github.com/opscode/chef.git
I ended up patching my chef 11.4.4 lib/chef/provider/package/rubygems.rb with this file: https://github.com/opscode/chef/blob/d6748efde62502ab6f5d97052f46ca00352497ef/lib/chef/provider/package/rubygems.rb
I had similar errors trying to use Chef (10.24 and 11.4) with Ruby 2.0 - so I assume Chef is not yet Ruby 2.0 compatible :(
The accepted answer is great if you're using the system ruby (/usr/bin/ruby, for example), but it didn't work for me because I'm using RVM. I found an equivalent solution in case you're using RVM:
rvm rubygems 1.8.25 will install rubygems version 1.8.25 for your RVM ruby.