I installed ruby for windows and then rubygems but am getting the following error when trying to use rubygems to install bundler.
C:\Users\tgandrews\Ruby\rubygems-1.8.24>gem install bundler --verbose --debug
Exception `NameError' at C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/command_manager.rb:177 - uninitialized constant Gem::Commands::InstallCommand
Exception `Errno::ENOENT' at C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/spec_fetcher.rb:54 - No such file or directory - Z:/
ERROR: While executing gem ... (Errno::ENOENT)
No such file or directory - Z:/
C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/spec_fetcher.rb:54:in `stat'
C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/spec_fetcher.rb:54:in `initialize'
C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/spec_fetcher.rb:43:in `new'
C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/spec_fetcher.rb:43:in `fetcher'
C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/dependency_installer.rb:110:in `find_gems_with_sources'
C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/dependency_installer.rb:228:in `find_spec_by_name_and_version'
C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/dependency_installer.rb:259:in `install'
C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/commands/install_command.rb:121:in `block in execute'
C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/commands/install_command.rb:115:in `each'
C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/commands/install_command.rb:115:in `execute'
C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/command.rb:278:in `invoke'
C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/command_manager.rb:147:in `process_args'
C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/command_manager.rb:117:in `run'
C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/gem_runner.rb:65:in `run'
C:/Ruby193/bin/gem:30:in `<main>'
My gem env returns the following
C:\Users\tgandrews\Ruby\rubygems-1.8.24>gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.24
- RUBY VERSION: 1.9.3 (2012-04-20 patchlevel 194) [i386-mingw32]
- INSTALLATION DIRECTORY: C:/Ruby193/lib/ruby/gems/1.9.1
- RUBY EXECUTABLE: C:/Ruby193/bin/ruby.exe
- EXECUTABLE DIRECTORY: C:/Ruby193/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-mingw32
- GEM PATHS:
- C:/Ruby193/lib/ruby/gems/1.9.1
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
This might be caused by a network drive and incorrect configuration of environment variables like HOME, HOMEDRIVE and/or HOMEPATH
Please see the following section of RubyInstaller troubleshooting section:
https://github.com/oneclick/rubyinstaller/wiki/Troubleshooting#wiki-network_drive_home
Related
When trying to execute my ruby script I receive the following error message
C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/dependency.rb:308:in `to_specs': Could
not find 'rubyzip' (~> 1.0) among 14 total gem(s) (Gem::MissingSpecError)
Checked in 'GEM_PATH=C:/Users/me/.gem/ruby/2.4.0;C:/Ruby24-
x64/lib/ruby/gems/2.4.0', execute `gem env` for more information
from C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/specification.rb:1442:in
`block in activate_dependencies'
from C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/specification.rb:1431:in
`each'
from C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/specification.rb:1431:in
`activate_dependencies'
from C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/specification.rb:1413:in
`activate'
from C:/Ruby24-x64/lib/ruby/2.4.0/rubygems.rb:220:in `rescue in
try_activate'
from C:/Ruby24-x64/lib/ruby/2.4.0/rubygems.rb:213:in `try_activate'
from C:/Ruby24-
x64/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:126:in `rescue in
require'
from C:/Ruby24-
x64/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:40:in `require'
from setupscript.rb:2:in `<main>'
I run gem env and the following is returned
RubyGems Environment:
- RUBYGEMS VERSION: 2.6.11
- RUBY VERSION: 2.4.1 (2017-03-22 patchlevel 111) [x64-mingw32]
- INSTALLATION DIRECTORY: C:/Ruby24-x64/lib/ruby/gems/2.4.0
- USER INSTALLATION DIRECTORY: C:/Users/me/.gem/ruby/2.4.0
- RUBY EXECUTABLE: C:/Ruby24-x64/bin/ruby.exe
- EXECUTABLE DIRECTORY: C:/Ruby24-x64/bin
- SPEC CACHE DIRECTORY: C:/Users/me/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: C:/ProgramData
- RUBYGEMS PLATFORMS:
- ruby
- x64-mingw32
- GEM PATHS:
- C:/Ruby24-x64/lib/ruby/gems/2.4.0
- C:/Users/me/.gem/ruby/2.4.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- :sources => []
- REMOTE SOURCES:
- SHELL PATH:
- C:\Program Files\ConEmu\ConEmu\Scripts
- C:\Program Files\ConEmu
- C:\Program Files\ConEmu\ConEmu
- C:\ProgramData\Oracle\Java\javapath
- C:\Windows\system32
- C:\Windows
- C:\Windows\System32\Wbem
- C:\Windows\System32\WindowsPowerShell\v1.0\
- C:\Program Files (x86)\Oracle\instantclient_11_2
- C:\Program Files (x86)\WebEx\Productivity Tools
- C:\Program Files\nodejs\
- C:\Program Files (x86)\Silk\SilkTest
- C:\Program Files (x86)\Silk\SilkTest\ng\gui
- C:\Program Files\Microsoft SQL Server\130\Tools\Binn\
- C:\Program Files\dotnet\
- C:\Ruby24-x64\bin
C:\Users\me\AppData\Local\Microsoft\WindowsApps,C:\Users\me\Documents\Automation\SeleniumBrowserDrivers\IEDriverServer_Win32_3.4.0\
- C:\Users\me\AppData\Local\Programs\Fiddler
- C:\Users\me\AppData\Roaming\npm"
My script is the sample ruby script on seleniumhq page.
require 'rubygems'
require 'selenium-webdriver'
driver = Selenium::WebDriver.for :IE
driver.get "http://google.com"
element = driver.find_element :name => "q"
element.send_keys "Cheese!"
element.submit
puts "Page title is #{driver.title}"
wait = Selenium::WebDriver::Wait.new(:timeout => 10)
wait.until { driver.title.downcase.start_with? "cheese!" }
puts "Page title is #{driver.title}"
driver.quit
Thanks,
Scott
For some reason I was unable to install rubyzip. I needed to
download the gem into my system
navigate to the folder
execute gem install --force --local *.gem
When I did the above steps the gem was installed.
Hello and thanks for your help in advance.
I'm having trouble installing Jekyll because I receive the following error:
ERROR: While executing gem ... (Errno::EINVAL)
Invalid argument
This is slightly different than the question already posted, here I've also followed all of those recommendations but nothing is working.
Current xCode version: 8
Current Ruby version: ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]
Here is the backtrace of the install:
Lisas-MBP:gems LMS$ gem install jekyll --backtrace
ERROR: While executing gem ... (Errno::EINVAL)
Invalid argument
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/resolv.rb:672:in `clock_gettime'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/resolv.rb:672:in `request'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/resolv.rb:531:in `block in fetch_resource'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/resolv.rb:1103:in `block (3 levels) in resolv'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/resolv.rb:1101:in `each'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/resolv.rb:1101:in `block (2 levels) in resolv'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/resolv.rb:1100:in `each'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/resolv.rb:1100:in `block in resolv'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/resolv.rb:1098:in `each'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/resolv.rb:1098:in `resolv'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/resolv.rb:522:in `fetch_resource'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/resolv.rb:512:in `each_resource'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/resolv.rb:493:in `getresource'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/rubygems/remote_fetcher.rb:99:in `api_endpoint'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/rubygems/source.rb:47:in `api_uri'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/rubygems/source.rb:86:in `dependency_resolver_set'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/rubygems/resolver/best_set.rb:24:in `block in pick_sets'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/rubygems/source_list.rb:98:in `each'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/rubygems/source_list.rb:98:in `each_source'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/rubygems/resolver/best_set.rb:23:in `pick_sets'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/rubygems/resolver/best_set.rb:29:in `find_all'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/rubygems/resolver/installer_set.rb:152:in `find_all'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/rubygems/resolver/installer_set.rb:55:in `add_always_install'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/rubygems/dependency_installer.rb:474:in `resolve_dependencies'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/rubygems/commands/install_command.rb:239:in `install_gem'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/rubygems/commands/install_command.rb:300:in `block in install_gems'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/rubygems/commands/install_command.rb:296:in `each'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/rubygems/commands/install_command.rb:296:in `install_gems'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/rubygems/commands/install_command.rb:203:in `execute'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/rubygems/command.rb:308:in `invoke_with_build_args'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/rubygems/command_manager.rb:169:in `process_args'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/rubygems/command_manager.rb:139:in `run'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/rubygems/gem_runner.rb:55:in `run'
/usr/local/bin/gem:21:in `<main>'
Here is my gem env
Lisas-MBP:Code LMS$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 2.5.1
- RUBY VERSION: 2.3.1 (2016-04-26 patchlevel 112) [x86_64-darwin15]
- INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/2.3.0
- USER INSTALLATION DIRECTORY: /Users/LMS/.gem/ruby/2.3.0
- RUBY EXECUTABLE: /usr/local/opt/ruby/bin/ruby
- EXECUTABLE DIRECTORY: /usr/local/bin
- SPEC CACHE DIRECTORY: /Users/LMS/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /usr/local/Cellar/ruby/2.3.1_1/etc
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-15
- GEM PATHS:
- /usr/local/lib/ruby/gems/2.3.0
- /Users/LMS/.gem/ruby/2.3.0
- /usr/local/Cellar/ruby/2.3.1_1/lib/ruby/gems/2.3.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /Library/Frameworks/Python.framework/Versions/3.4/bin
- /Library/Frameworks/Python.framework/Versions/3.4/bin
- /Library/Frameworks/Python.framework/Versions/3.5/bin
- /Library/Frameworks/Python.framework/Versions/3.5/bin
- /opt/local/bin
- /opt/local/sbin
- /usr/local/bin
- /usr/local/bin
- /usr/bin
- /bin
- /usr/sbin
- /sbin
- /user/local/bin
- /Users/LMS/.rvm/bin
- /Applications/Postgres.app/Contents/Versions/9.4/bin
I'm able to successfully install jekyll on my Mac but I'm not using system Ruby. I'd highly recommend using RBEnv to manage your Ruby installation on OSX. You'll find it much easier to work with than trying to deal with the system version or the Brew version. With it you can swap out Ruby versions easily and gem management is simpler.
Thanks for all the responses.
I ended up uninstalling ruby and re-installing it.
Then I started getting other issues, but new issues are good!
And this finally fixed it.
sudo gem install -n /usr/local/bin/ jekyll
Now I'm running ruby 2.0. Hope this helps, let me know if anyone has any questions!
I know this question has been asked before, yet I've not been able to remedy it with the existing advice.
My gem environment is as follows:
gem environment
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.7
- RUBY VERSION: 1.9.3 (2014-10-27 patchlevel 550) [x86_64-linux]
- INSTALLATION DIRECTORY: /usr/lib/ruby/gems/1.9.1
- RUBY EXECUTABLE: /usr/bin/ruby1.9.1
- EXECUTABLE DIRECTORY: /usr/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /usr/lib/ruby/gems/1.9.1
- /home/egge/.gem/ruby/1.9.1
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
I installed the my gem:
gem list --local | grep active
activesupport (4.1.7)
activesupport-inflector (0.1.0)
But when I run ruby, it can't find it:
/usr/bin/ruby1.9.1 -e 'require "active_support/inflector"'
-e:1:in `require': cannot load such file -- active_support/inflector (LoadError)
from -e:1:in `<main>'
I am at a loss as to why this setup isn't working.
I found a workaround. I'm not sure what the cause of my issue is, but apparently there is some change with Ruby 1.9.2+. The following works fine:
/usr/bin/ruby1.9.1 --disable-gems -e 'require "rubygems"; require "active_support/inflector"'
I'm using Linux Mint. I've already installed jruby and jdk.
When I check ruby version it gives me correct message
ruby -v
jruby 1.7.11 (1.9.3p392) 2014-02-24 86339bb on Java HotSpot(TM) Server VM 1.8.0_05-b13 +indy [linux-i386]
But when I try to install some gems like this:
gem install bundler
It gives me this message:
ERROR: While executing gem ... (SocketError)
recv: name or service not known
which jruby
/home/msdc/.rvm/rubies/jruby-1.7.11/bin/jruby
which gem
/home/msdc/.rvm/rubies/jruby-1.7.11/bin/gem
gem env
RubyGems Environment:
- RUBYGEMS VERSION: 2.2.2
- RUBY VERSION: 1.9.3 (2014-02-24 patchlevel 392) [java]
- INSTALLATION DIRECTORY: /home/msdc/.rvm/gems/jruby-1.7.11
- RUBY EXECUTABLE: /home/msdc/.rvm/rubies/jruby-1.7.11/bin/jruby
- EXECUTABLE DIRECTORY: /home/msdc/.rvm/gems/jruby-1.7.11/bin
- SPEC CACHE DIRECTORY: /home/msdc/.gem/specs
- RUBYGEMS PLATFORMS:
- ruby
- universal-java-1.8
- GEM PATHS:
- /home/msdc/.rvm/gems/jruby-1.7.11
- /home/msdc/.rvm/gems/jruby-1.7.11#global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- "install" => "--no-rdoc --no-ri --env-shebang"
- "update" => "--no-rdoc --no-ri --env-shebang"
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /home/msdc/.rvm/gems/jruby-1.7.11/bin
- /home/msdc/.rvm/gems/jruby-1.7.11#global/bin
- /home/msdc/.rvm/rubies/jruby-1.7.11/bin
- /usr/local/sbin
- /usr/local/bin
- /usr/sbin
- /usr/bin
- /sbin
- /bin
- /usr/games
- /home/msdc/bin
- /usr/local/java/jdk1.8.0_05/bin
- /home/msdc/bin
- /usr/local/java/jdk1.8.0_05/jre/bin
- /home/msdc/bin
- /usr/local/java/jdk1.8.0_05/bin
- /home/msdc/bin
- /usr/local/java/jdk1.8.0_05/jre/bin
- /home/msdc/.rvm/bin
When I run gem install bundler in debug mode it gives me this:
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/1.9/resolv.rb:775:in `recv_reply'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/1.9/resolv.rb:663:in `request'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/1.9/resolv.rb:511:in `each_resource'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/1.9/resolv.rb:0:in `resolv'
org/jruby/RubyArray.java:1613:in `each'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/1.9/resolv.rb:1026:in `resolv'
org/jruby/RubyArray.java:1613:in `each'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/1.9/resolv.rb:1025:in `resolv'
org/jruby/RubyArray.java:1613:in `each'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/1.9/resolv.rb:1023:in `resolv'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/1.9/resolv.rb:503:in `each_resource'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/1.9/resolv.rb:480:in `getresource'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/shared/rubygems/remote_fetcher.rb:88:in `api_endpoint'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/shared/rubygems/source.rb:42:in `api_uri'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/shared/rubygems/source.rb:170:in `load_specs'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/shared/rubygems/spec_fetcher.rb:265:in `tuples_for'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/shared/rubygems/spec_fetcher.rb:226:in `available_specs'
org/jruby/RubyArray.java:1613:in `each'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/shared/rubygems/source_list.rb:97:in `each_source'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/shared/rubygems/spec_fetcher.rb:222:in `available_specs'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/shared/rubygems/spec_fetcher.rb:102:in `search_for_dependency'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/shared/rubygems/dependency_installer.rb:216:in `find_gems_with_sources'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/shared/rubygems/dependency_installer.rb:292:in `find_spec_by_name_and_version'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/shared/rubygems/dependency_installer.rb:166:in `available_set_for'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/shared/rubygems/dependency_installer.rb:418:in `resolve_dependencies'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/shared/rubygems/dependency_installer.rb:371:in `install'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/shared/rubygems/commands/install_command.rb:219:in `install_gem'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/shared/rubygems/commands/install_command.rb:263:in `install_gems'
org/jruby/RubyArray.java:1613:in `each'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/shared/rubygems/commands/install_command.rb:259:in `install_gems'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/shared/rubygems/commands/install_command.rb:171:in `execute'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/shared/rubygems/command.rb:305:in `invoke_with_build_args'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/shared/rubygems/command_manager.rb:167:in `process_args'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/shared/rubygems/command_manager.rb:137:in `run'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/shared/rubygems/gem_runner.rb:54:in `run'
/home/msdc/.rvm/rubies/jruby-1.7.11/bin/jgem:21:in `(root)'
org/jruby/RubyKernel.java:1101:in `load'
/home/msdc/.rvm/rubies/jruby-1.7.11/bin/gem:4:in `(root)'
Exception `Gem::SystemExitException' at /home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/shared/rubygems/user_interaction.rb:381 - Exiting RubyGems with exit_code 1
I'd suggest trying http://rubygems.org and seeing if that works. https should work, but at least then you'd know more precisely what the problem is. You'll probably find this config information in your ~/.gemrc file.
I encountered this issue:
gabriele # osiris { ~ } [ ven nov 15 ] [ 12:57 ]
> jekyll
/var/lib/gems/1.8/gems/highline-1.6.19/lib/highline/system_extensions.rb:210: warning: Insecure world writable dir /home/gabriele in PATH, mode 040777
/var/lib/gems/1.8/gems/commander-4.1.3/lib/commander/runner.rb:365:in `require_program': program version required (Commander::Runner::CommandError)
from /var/lib/gems/1.8/gems/commander-4.1.3/lib/commander/runner.rb:364:in `each'
from /var/lib/gems/1.8/gems/commander-4.1.3/lib/commander/runner.rb:364:in `require_program'
from /var/lib/gems/1.8/gems/commander-4.1.3/lib/commander/runner.rb:52:in `run!'
from /var/lib/gems/1.8/gems/commander-4.1.3/lib/commander/delegates.rb:7:in `run!'
from /var/lib/gems/1.8/gems/commander-4.1.3/lib/commander/import.rb:10
from /usr/local/bin/jekyll:19
/usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require': no such file to load -- json (LoadError)
from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `require'
from /var/lib/gems/1.8/gems/jekyll-1.3.0/bin/../lib/jekyll/filters.rb:2
from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `require'
from /var/lib/gems/1.8/gems/jekyll-1.3.0/bin/../lib/jekyll.rb:43
from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `require'
from /var/lib/gems/1.8/gems/jekyll-1.3.0/bin/jekyll:7
from /usr/local/bin/jekyll:19:in `load'
from /usr/local/bin/jekyll:19
after I've installed jekyll on Ubuntu 12.04 with
sudo apt-get install ruby1.9.1-dev && sudo gem install jekyll
This is my gem env:
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.15
- RUBY VERSION: 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
- INSTALLATION DIRECTORY: /var/lib/gems/1.8
- RUBY EXECUTABLE: /usr/bin/ruby1.8
- EXECUTABLE DIRECTORY: /usr/local/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /var/lib/gems/1.8
- /home/gabriele/.gem/ruby/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
How can i solve it?
Running gem install json should fix the LoadError.
Commander throws that program version required error whenever there is a problem loading in the executable (in this case, bin/jekyll). As 1.8.7 can't load an internal json library (introduced in 1.9), you'll need to install the gem.