Trying to install ruby 2.1.4 using latest rvm on Mac OS X Mavericks...
rvm fails to install ruby 2.1.4
Cryptic error message about empty default gemset ??
Tried installing twice.
I was able to install ruby 2.1.3 few days ago, and all was okay
Help appreciated
helabed#hani-elabeds-MacBook-Pro:~/rails-proj $ rvm info
ruby-2.1.3#rspec-2:
system:
uname: "Darwin hani-elabeds-MacBook-Pro.local 13.4.0 Darwin Kernel Version 13.4.0: Sun Aug 17 19:50:11 PDT 2014; root:xnu-2422.115.4~1/RELEASE_X86_64 x86_64"
system: "osx/10.9/x86_64"
bash: "/bin/bash => GNU bash, version 3.2.51(1)-release (x86_64-apple-darwin13)"
zsh: "/bin/zsh => zsh 5.0.2 (x86_64-apple-darwin13.0)"
rvm:
version: "rvm 1.26.0 (latest) by Wayne E. Seguin , Michal Papis [https://rvm.io/]"
updated: "21 minutes 6 seconds ago"
path: "/Users/helabed/.rvm"
ruby:
interpreter: "ruby"
version: "2.1.3p242"
date: "2014-09-19"
platform: "x86_64-darwin14.0"
patchlevel: "2014-09-19 revision 47630"
full_version: "ruby 2.1.3p242 (2014-09-19 revision 47630) [x86_64-darwin14.0]"
homes:
gem: "/Users/helabed/.rvm/gems/ruby-2.1.3#rspec-2"
ruby: "/Users/helabed/.rvm/rubies/ruby-2.1.3"
binaries:
ruby: "/Users/helabed/.rvm/rubies/ruby-2.1.3/bin/ruby"
irb: "/Users/helabed/.rvm/rubies/ruby-2.1.3/bin/irb"
gem: "/Users/helabed/.rvm/rubies/ruby-2.1.3/bin/gem"
rake: "/Users/helabed/.rvm/rubies/ruby-2.1.3/bin/rake"
environment:
PATH: "/Users/helabed/.rvm/gems/ruby-2.1.3#rspec-2/bin:/Users/helabed/.rvm/gems/ruby-2.1.3#global/bin:/Users/helabed/.rvm/rubies/ruby-2.1.3/bin:/Users/helabed/.rvm/bin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/helabed/bin:/usr/local/mysql/bin:/Users/helabed/Android/adt-bundle-mac-x86_64-20140321/sdk/platform-tools:/Users/helabed/Android/adt-bundle-mac-x86_64-20140321/sdk/tools/"
GEM_HOME: "/Users/helabed/.rvm/gems/ruby-2.1.3#rspec-2"
GEM_PATH: "/Users/helabed/.rvm/gems/ruby-2.1.3#rspec-2:/Users/helabed/.rvm/gems/ruby-2.1.3#global"
MY_RUBY_HOME: "/Users/helabed/.rvm/rubies/ruby-2.1.3"
IRBRC: "/Users/helabed/.rvm/rubies/ruby-2.1.3/.irbrc"
RUBYOPT: ""
gemset: "rspec-2"
helabed#hani-elabeds-MacBook-Pro:~/rails-proj $ gem list
*** LOCAL GEMS ***
bigdecimal (1.2.4)
bundler (1.7.4)
bundler-unload (1.0.2)
diff-lcs (1.2.5)
executable-hooks (1.3.2)
gem-wrappers (1.2.7)
io-console (0.4.2)
json (1.8.1)
minitest (4.7.5)
psych (2.0.5)
rake (10.1.0)
rdoc (4.1.0)
rspec (2.13.0)
rspec-core (2.13.1)
rspec-expectations (2.13.0)
rspec-mocks (2.13.1)
rubygems-bundler (1.4.4)
rvm (1.11.3.9)
test-unit (2.1.3.0)
helabed#hani-elabeds-MacBook-Pro:~/rails-proj $ rvm reinstall 2.1.4
ruby-2.1.4 - #removing rubies/ruby-2.1.4..
Searching for binary rubies, this might take some time.
Found remote file https://rubies.travis-ci.org/osx/10.9/x86_64/ruby-2.1.4.tar.bz2
Checking requirements for osx.
Certificates in '/usr/local/etc/openssl/cert.pem' are already up to date.
Requirements installation successful.
ruby-2.1.4 - #configure
ruby-2.1.4 - #download
ruby-2.1.4 - #validate archive
ruby-2.1.4 - #extract
ruby-2.1.4 - #validate binary
ruby-2.1.4 - #setup
ruby-2.1.4 - #gemset created /Users/helabed/.rvm/gems/ruby-2.1.4#global
ruby-2.1.4 - #importing gemset /Users/helabed/.rvm/gemsets/global.gems........................................................................
ruby-2.1.4 - #generating global wrappers..............
ruby-2.1.4 - #gemset created /Users/helabed/.rvm/gems/ruby-2.1.4
ruby-2.1.4 - #importing gemsetfile /Users/helabed/.rvm/gemsets/default.gems evaluated to empty gem list
ruby-2.1.4 - #generating default wrappers..............
/Users/helabed/.rvm/scripts/functions/support: line 490: 17899 Trace/BPT trap: 5 "$ruby_path" -rrbconfig -e '\
File.open("'"$config_path"'","w") { |file|
RbConfig::CONFIG.sort.each{|key,value|
file.write("#{key.gsub(/\.|-/,"_")}=\"#{value.gsub("$","\\$")}\"\n")
}
}
' > /dev/null 2>&1
Empty path passed to certificates update, functions stack: requirements_osx_update_openssl_cert_run rvm_requiremnts_fail_or_run_action __rvm_osx_ssl_certs_ensure_for_ruby __rvm_osx_ssl_certs_ensure_for_ruby_except_jruby external_import_setup external_import main
Making gemset ruby-2.1.4 pristine................................................................
Making gemset ruby-2.1.4#global pristine.................................................................
helabed#hani-elabeds-MacBook-Pro:~/rails-proj $
I had a similar problem with 2.1.4, rvm reinstall 2.1.4 --disable-binary worked for me. thanks to #csage for the pointer.
similar issue here
Error when installing Ruby 2.1.3 with RVM
I ran into similar issues where 2.1.3 and 2.1.4 hang on the compilation step.
This solved my issue:
rvm install 2.1.4 -- --with-setjmp-type=setjmp
original source of fix
Related
I have ruby 2.2.0 and I use RVM for a project that requires 2.0.0
After installing RVM I tried to use sass or compass gems outside the project and got this:
$ compass watch
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency.rb:296:in `to_specs': Could not find 'compass' (>= 0) among 49 total gem(s) (Gem::LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency.rb:307:in `to_spec'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_gem.rb:47:in `gem'
from /usr/bin/compass:22:in `<main>'
I tried removing RVM and reinstalling the gems and all worked fine, but I need it for the project.
Why is it looking in 2.0 folder? When I do rvm info I get ruby-2.2.0:
Update:
$ which ruby
/Users/ilyo/.rvm/rubies/ruby-2.2.0/bin/ruby
$ which compass
/usr/bin/compass
$rvm info
ruby-2.2.0:
system:
uname: "Darwin ilyo-audyx.local 14.0.0 Darwin Kernel Version 14.0.0: Fri Sep 19 00:26:44 PDT 2014; root:xnu-2782.1.97~2/RELEASE_X86_64 x86_64"
system: "osx/10.10/x86_64"
bash: "/bin/bash => GNU bash, version 3.2.53(1)-release (x86_64-apple-darwin14)"
zsh: "/bin/zsh => zsh 5.0.5 (x86_64-apple-darwin14.0)"
rvm:
version: "rvm 1.26.9 (latest) by Wayne E. Seguin <wayneeseguin#gmail.com>, Michal Papis <mpapis#gmail.com> [https://rvm.io/]"
updated: "4 days 7 hours 57 minutes 33 seconds ago"
path: "/Users/ilyo/.rvm"
ruby:
interpreter: "ruby"
version: "2.2.0p0"
date: "2014-12-25"
platform: "x86_64-darwin14"
patchlevel: "2014-12-25 revision 49005"
full_version: "ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin14]"
homes:
gem: "/Users/ilyo/.rvm/gems/ruby-2.2.0"
ruby: "/Users/ilyo/.rvm/rubies/ruby-2.2.0"
binaries:
ruby: "/Users/ilyo/.rvm/rubies/ruby-2.2.0/bin/ruby"
irb: "/Users/ilyo/.rvm/rubies/ruby-2.2.0/bin/irb"
gem: "/Users/ilyo/.rvm/rubies/ruby-2.2.0/bin/gem"
rake: "/Users/ilyo/.rvm/rubies/ruby-2.2.0/bin/rake"
environment:
PATH: "/Users/ilyo/.rvm/gems/ruby-2.2.0/bin:/Users/ilyo/.rvm/gems/ruby-2.2.0#global/bin:/Users/ilyo/.rvm/rubies/ruby-2.2.0/bin:/Users/ilyo/.rvm/bin:/usr/local/bin:/Users/ilyo/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
GEM_HOME: "/Users/ilyo/.rvm/gems/ruby-2.2.0"
GEM_PATH: "/Users/ilyo/.rvm/gems/ruby-2.2.0:/Users/ilyo/.rvm/gems/ruby-2.2.0#global"
MY_RUBY_HOME: "/Users/ilyo/.rvm/rubies/ruby-2.2.0"
IRBRC: "/Users/ilyo/.rvm/rubies/ruby-2.2.0/.irbrc"
RUBYOPT: ""
gemset: ""
I am currently trying to get https://github.com/heroku/umpire working locally on my Ubuntu machine with graphite.
I have done the following steps on version 12.04 of Ubuntu:
git clone https://github.com/heroku/umpire
cd umpire
sudo apt-get install ruby-rvm
sudo rvm install ruby-1.9.2-p180
sudo apt-get install ruby-bundler
The line that is producing the error in the Gemfile:
gem 'rack-timeout', git: "https://github.com/freeformz/rack-timeout.git"
This is the error that I am getting in the terminal:
/home/vagrant/umpire/Gemfile:9:in `evaluate': compile error (SyntaxError)
/home/vagrant/umpire/Gemfile:9: syntax error, unexpected ':', expecting $end
gem 'rack-timeout', git: "https://github.com/freeformz...
^
from /usr/lib/ruby/vendor_ruby/bundler/definition.rb:17:in `build'
from /usr/lib/ruby/vendor_ruby/bundler.rb:136:in `definition'
I've been trying to fix this for a while but I am not particularly familiar with Ruby. Does anyone know how fix this?
Thank you in advance for any help.
I would not use the apt provided rvm. It's old and broken in a few ways AFAICT.
Start here: Installed Ruby 1.9.3 with RVM but command line doesn't show ruby -v
Once I did that I was able to install the right version of ruby for my user and bundle install...
vagrant#ubuntu-12:~$ cd umpire/
RVM used your Gemfile for selecting Ruby, it is all fine - Heroku does that too,
you can ignore these warnings with 'rvm rvmrc warning ignore /home/vagrant/umpire/Gemfile'.
To ignore the warning for all files run 'rvm rvmrc warning ignore allGemfiles'.
ruby-1.9.3-p547 is not installed.
To install do: 'rvm install ruby-1.9.3-p547'
vagrant#ubuntu-12:~/umpire$ rvm install ruby-1.9.3-p547
Searching for binary rubies, this might take some time.
Found remote file https://rvm.io/binaries/ubuntu/12.04/x86_64/ruby-1.9.3-p547.tar.bz2
Checking requirements for ubuntu.
Requirements installation successful.
ruby-1.9.3-p547 - #configure
ruby-1.9.3-p547 - #download
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 11.3M 100 11.3M 0 0 1851k 0 0:00:06 0:00:06 --:--:-- 2137k
ruby-1.9.3-p547 - #validate archive
ruby-1.9.3-p547 - #extract
ruby-1.9.3-p547 - #validate binary
ruby-1.9.3-p547 - #setup
ruby-1.9.3-p547 - #gemset created /home/vagrant/.rvm/gems/ruby-1.9.3-p547#global
ruby-1.9.3-p547 - #importing gemset /home/vagrant/.rvm/gemsets/global.gems....................................
ruby-1.9.3-p547 - #generating global wrappers........
ruby-1.9.3-p547 - #gemset created /home/vagrant/.rvm/gems/ruby-1.9.3-p547
ruby-1.9.3-p547 - #importing gemsetfile /home/vagrant/.rvm/gemsets/default.gems evaluated to empty gem list
ruby-1.9.3-p547 - #generating default wrappers........
vagrant#ubuntu-12:~/umpire$ bundle install
Fetching gem metadata from https://rubygems.org/.........
Fetching https://github.com/freeformz/rack-timeout.git
Installing rake 10.1.1
Installing addressable 2.3.5
Installing aggregate 0.2.2
Installing safe_yaml 0.9.7
Installing crack 0.4.1
Installing diff-lcs 1.2.5
Installing excon 0.31.0
Installing multipart-post 1.2.0
Installing faraday 0.8.9
Installing multi_json 1.8.4
Installing librato-metrics 1.3.0
Installing rack 1.5.2
Installing puma 2.7.1
Installing rack-protection 1.5.1
Installing rack-ssl 1.3.3
Installing rack-test 0.6.2
Using rack-timeout 0.1.0beta2 from https://github.com/freeformz/rack-timeout.git (at master)
Installing rspec-core 2.14.7
Installing rspec-expectations 2.14.4
Installing rspec-mocks 2.14.4
Installing rspec 2.14.1
Installing scrolls 0.3.3
Installing tilt 1.4.1
Installing sinatra 1.4.4
Installing webmock 1.16.1
Installing yajl-ruby 1.2.0
Using bundler 1.6.2
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.
vagrant#ubuntu-12:~/umpire$
I am using travis for the first time and am trying to understand why my bundle installed gems are not available with ruby 1.8.7
Gemfile
source 'https://rubygems.org'
gem 'rspec'
.travis.yml
language: ruby
script: bundle exec rspec
rvm:
- 1.8.7
- 1.9.3
- 2.0.0
travis output
$ rvm use 1.8.7 --install --binary --fuzzy
Using /home/travis/.rvm/gems/ree-1.8.7-2012.02
$ export BUNDLE_GEMFILE=$PWD/Gemfile
$ ruby --version
ruby 1.8.7 (2013-06-27 MBARI 8/0x6770 on patchlevel 374) [x86_64-linux], MBARI 0x6770, Ruby Enterprise Edition 2012.02
$ rvm --version
rvm 1.25.20 (version) by Wayne E. Seguin <wayneeseguin#gmail.com>, Michal Papis <mpapis#gmail.com> [https://rvm.io/]
$ gem --version
2.0.14
$ bundle --version
Bundler version 1.6.1
$ bundle install --deployment
Fetching gem metadata from https://rubygems.org/...
Fetching additional metadata from https://rubygems.org/..
Installing diff-lcs 1.2.5
Installing rspec-core 2.14.8
Installing rspec-expectations 2.14.5
Installing rspec-mocks 2.14.6
Installing rspec 2.14.1
Using bundler 1.6.1
Your bundle is complete!
It was installed into ./vendor/bundle
$ bundle exec rspec
Could not find diff-lcs-1.2.5 in any of the sources
Run `bundle install` to install missing gems.
Based on other references, the suggested .yml file would be:
language: ruby
script: "bundle exec rspec"
rvm:
- 1.8.7
- 1.9.3
- 2.0.0
Refer to: https://coderwall.com/p/x8exja
Looks like a bug in Travis-ci: https://github.com/travis-ci/travis-ci/issues/2253
There appears to be a workaround, but it haven't tried it.
I seem to be getting an odd issue here, not sure where to look to debug it. I have had Ruby installed on my machine for a while now but today have added RVM. So I will run through the steps I am taking:
My Gemfile:
source 'https://rubygems.org'
gem 'capistrano', '~> 3.1.0'
Try to install:
$ bundle
Fetching gem metadata from https://rubygems.org/.......
Installing rake (10.2.1)
Gem::InstallError: rake requires Ruby version >= 1.9.
An error occured while installing rake (10.2.1), and Bundler cannot continue.
Make sure that `gem install rake -v '10.2.1'` succeeds before bundling.
Check Ruby version, which is greater than 1.9:
$ ruby -v
ruby 2.0.0p247 (2013-06-27 revision 41674) [universal.x86_64-darwin13]
Make sure rake is installed:
$ gem list
*** LOCAL GEMS ***
...
rake (10.2.1)
...
Try installing rake anyway:
$ sudo gem install rake -v '10.2.1'
Successfully installed rake-10.2.1
Parsing documentation for rake-10.2.1
1 gem installed
Make sure rake is installed:
$ gem list
*** LOCAL GEMS ***
...
rake (10.2.1)
...
Try again:
$ bundle
Fetching gem metadata from https://rubygems.org/.......
Installing rake (10.2.1)
Gem::InstallError: rake requires Ruby version >= 1.9.
An error occured while installing rake (10.2.1), and Bundler cannot continue.
Make sure that `gem install rake -v '10.2.1'` succeeds before bundling.
Perhaps some useful information:
$ rvm info
system:
system:
uname: "Darwin ians-MacBook-Pro.local 13.1.0 Darwin Kernel Version 13.1.0: Thu Jan 16 19:40:37 PST 2014; root:xnu-2422.90.20~2/RELEASE_X86_64 x86_64"
system: "osx/10.9/x86_64"
bash: "/bin/bash => GNU bash, version 3.2.51(1)-release (x86_64-apple-darwin13)"
zsh: "/bin/zsh => zsh 5.0.2 (x86_64-apple-darwin13.0)"
rvm:
version: "rvm 1.25.22 (stable) by Wayne E. Seguin <wayneeseguin#gmail.com>, Michal Papis <mpapis#gmail.com> [https://rvm.io/]"
updated: "3 hours 34 minutes 31 seconds ago"
path: "/Users/ianjamieson/.rvm"
homes:
gem: "not set"
ruby: "not set"
binaries:
ruby: "/usr/bin/ruby"
irb: "/usr/bin/irb"
gem: "/usr/bin/gem"
rake: "/usr/bin/rake"
environment:
PATH: "/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/Applications/android-developer-tools/sdk/platform-tools:/Applications/android-developer-tools/sdk/tools:/usr/lib/apache-ant-1.9.2/bin:/usr/local/mysql/bin:/Applications/android-developer-tools/sdk/platform-tools:/Applications/android-developer-tools/sdk/tools::/usr/lib/apache-ant-1.9.2/bin:/usr/local/mysql/bin:/Users/ianjamieson/.rvm/bin"
GEM_HOME: ""
GEM_PATH: ""
MY_RUBY_HOME: ""
IRBRC: ""
RUBYOPT: ""
gemset: ""
Thanks.
The fix for me was:
$ rvm reinstall 2.1.1
It seems as though, when I installed this version the first time round it didn't complete correctly and didn't update all the paths. So gem install was installing my gems in the wrong place.
I tried to use Jekyll new command, but it didn't work and came out following errors.
$ jekyll new myblog
/Library/Ruby/Gems/1.8/gems/commander-4.1.6/lib/commander/runner.rb:385:in `require_program': program version required (Commander::Runner::CommandError)
from /Library/Ruby/Gems/1.8/gems/commander-4.1.6/lib/commander/runner.rb:384:in `each'
from /Library/Ruby/Gems/1.8/gems/commander-4.1.6/lib/commander/runner.rb:384:in `require_program'
from /Library/Ruby/Gems/1.8/gems/commander-4.1.6/lib/commander/runner.rb:52:in `run!'
from /Library/Ruby/Gems/1.8/gems/commander-4.1.6/lib/commander/delegates.rb:8:in `run!'
from /Library/Ruby/Gems/1.8/gems/commander-4.1.6/lib/commander/import.rb:10
from /usr/bin/jekyll:23
/Library/Ruby/Site/1.8/rubygems/core_ext/kernel_require.rb:55:in `gem_original_require': no such file to load -- json (LoadError)
from /Library/Ruby/Site/1.8/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Library/Ruby/Gems/1.8/gems/jekyll-1.4.3/bin/../lib/jekyll/filters.rb:2
from /Library/Ruby/Site/1.8/rubygems/core_ext/kernel_require.rb:55:in `gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Library/Ruby/Gems/1.8/gems/jekyll-1.4.3/bin/../lib/jekyll.rb:44
from /Library/Ruby/Site/1.8/rubygems/core_ext/kernel_require.rb:55:in `gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Library/Ruby/Gems/1.8/gems/jekyll-1.4.3/bin/jekyll:7
from /usr/bin/jekyll:23:in `load'
from /usr/bin/jekyll:23
I'm using Mac OS X 10.8.5 Mountain Lion.
I checked stackoverflow and found a post which has a similar problem.
Error when running jekyll new command
Then I tried the below command.
$ sudo gem install json
but It didn't work for my situation. I uninstalled and reinstalled json but nothing happened.
Please let me know if you know any other solutions. I've been stuck on this problem since the beginning of the week...
my gem list & gem environment are as follows.
$ gem list
*** LOCAL GEMS ***
bigdecimal (1.2.4)
blankslate (2.1.2.4)
classifier (1.3.4)
colorator (0.1)
commander (4.1.6)
fast-stemmer (1.0.2)
ffi (1.9.3)
highline (1.6.21)
io-console (0.4.2)
jekyll (1.4.3)
json (1.8.1)
liquid (2.5.5)
listen (1.3.1)
maruku (0.7.1)
minitest (4.7.5)
parslet (1.5.0)
posix-spawn (0.3.8)
psych (2.0.3)
pygments.rb (0.5.4)
rake (10.1.0)
rb-fsevent (0.9.4)
rb-inotify (0.9.3)
rb-kqueue (0.2.2)
rdoc (4.1.0)
redcarpet (2.3.0)
safe_yaml (0.9.7)
test-unit (2.1.1.0)
toml (0.1.1)
yajl-ruby (1.1.0)
$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 2.2.2
- RUBY VERSION: 2.1.1 (2014-02-24 patchlevel 76) [x86_64-darwin12.0]
- INSTALLATION DIRECTORY: /usr/local/Cellar/ruby/2.1.1/lib/ruby/gems/2.1.0
- RUBY EXECUTABLE: /usr/local/Cellar/ruby/2.1.1/bin/ruby
- EXECUTABLE DIRECTORY: /usr/local/Cellar/ruby/2.1.1/bin
- SPEC CACHE DIRECTORY: /Users/MyName/.gem/specs
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-12
- GEM PATHS:
- /usr/local/Cellar/ruby/2.1.1/lib/ruby/gems/2.1.0
- /Users/MyName/.gem/ruby/2.1.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /usr/local/bin
- /usr/local/bin
- /usr/local/sbin
- /usr/bin
- /bin
- /usr/sbin
- /sbin
- /usr/local/git/bin
- /Users/MyName/.rvm/bin
Please give me advice to help me. Thank you!
Updated on Mar 7.
$ rvm list
rvm rubies
# No rvm rubies installed yet. Try 'rvm help install'.
Just in case you would like to see Homebrew list,
$ brew list
autoconf gmp4 libtool openssl readline
automake libgpg-error libyaml pkg-config ruby
cloog-ppl015 libksba llvm ppl011 ruby-build
gcc46 libmpc08 mpfr2 rbenv
2nd updated on Mar 7.
$ which ruby
/usr/local/bin/ruby
$ which jekyll
/usr/bin/jekyll
$ ruby --version
ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin12.0]
$ echo $PATH
/usr/local/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin:/Users/MyName/.rvm/bin
I remember that my mac had been installed Ruby 1.8.7 before I installed 2.1.1p76.
It looks like you have multiple versions of Ruby on your system (1.8.7 and 2.1.1), which is very common, and part of the reason tools like rvm and rbenv were created. The issue is that when you did gem install jekyll (maybe with a sudo) and sudo gem install json, these seem to have ended up in different spots and aren't finding each other. The /usr/local/bin location is typically where Homebrew puts things (hence, you have ruby listed under brew list) and this is your Ruby 2.1.1 location. However, your jekyll installation is under the location of the Apple-installed Ruby 1.8.7.
Step 1: try gem uninstall jekyll, then gem install jekyll. This should fix your problems.
Step 2: If that doesn't work, try to use rbenv or rvm to select a different version of Ruby, then try Step 1 again.
For example, my installations are here (managed via rvm):
$ which jekyll
/Users/nicksuch/.rvm/gems/ruby-2.0.0-p247/bin/jekyll
$ which gem
/Users/nicksuch/.rvm/rubies/ruby-2.0.0-p247/bin/gem
$ which ruby
/Users/nicksuch/.rvm/rubies/ruby-2.0.0-p247/bin/ruby
In my case the Jekyll template suggested to use bundle utility as:
bundle exec jekyll build
The solution was to include json into Gemfile (which was already part of the sources):
diff --git a/Gemfile b/Gemfile
index 98b29af..b8537cf 100644
--- a/Gemfile
+++ b/Gemfile
## -1,7 +1,8 ##
source "https://rubygems.org"
+gem "json"
gem "jekyll", "~> 3.0"
gem "jekyll-sitemap"
DETAILS
What lead me to the solution was the following fact:
command gem list json showed json gem installed;
but command bundle exec gem list json didn't show anything.
I also tried to run bundle exec gem install json - it didn't work. My best guess was that bundle sets up the environment for a single run based on Gemfile which is the only way to make set of dependencies persistent across each bundle exec ... executions.