I was trying to setup a GitHub Page using Jekyll, which rely on Ruby (like here). Unfortunately, I think I kind of messed up with the installation (after a few sudo apt-get install ruby-full and sudo apt-get remove ruby-full ...)
Right now, I am stuck with an old version of Ruby (I think) on my computer that I am not able to update. Here is the state of my system right now:
$ ruby -v
ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux-gnu]
$ gem -v
3.1.2
$ gem install jekyll
ERROR: Error installing jekyll:
The last version of sass-embedded (~> 1.54) to support your Ruby & RubyGems was 1.58.0. Try installing it with `gem install sass-embedded -v 1.58.0` and then running the current command again
sass-embedded requires RubyGems version >= 3.3.22. The current RubyGems version is 3.1.2. Try 'gem update --system' to update RubyGems itself.
$ gem update --system
Updating rubygems-update
Successfully installed rubygems-update-3.4.6
Parsing documentation for rubygems-update-3.4.6
Done installing documentation for rubygems-update after 0 seconds
Parsing documentation for rubygems-update-3.4.6
Done installing documentation for rubygems-update after 0 seconds
Installing RubyGems 3.4.6
Traceback (most recent call last):
5: from setup.rb:22:in `<main>'
4: from setup.rb:22:in `require'
3: from /home/jarret/gems/gems/rubygems-update-3.4.6/lib/rubygems.rb:1332:in `<top (required)>'
2: from /home/jarret/gems/gems/rubygems-update-3.4.6/lib/rubygems.rb:1332:in `require'
1: from /usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:49:in `<top (required)>'
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:50:in `<class:Specification>': undefined method `rubyforge_project=' for class `Gem::Specification' (NameError)
3: from setup.rb:22:in `<main>'
2: from setup.rb:22:in `require'
1: from /home/jarret/gems/gems/rubygems-update-3.4.6/lib/rubygems.rb:1328:in `<top (required)>'
/home/jarret/gems/gems/rubygems-update-3.4.6/lib/rubygems.rb:1342:in `rescue in <top (required)>': undefined method `rubyforge_project=' for class `Gem::Specification' (NameError)
Loading the /usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb file caused an error. This file is owned by your OS, not by rubygems upstream. Please find out which OS package this file belongs to and follow the guidelines from your OS to report the problem and ask for help.
$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 3.1.2
- RUBY VERSION: 2.7.0 (2019-12-25 patchlevel 0) [x86_64-linux-gnu]
- INSTALLATION DIRECTORY: /home/jarret/gems
- USER INSTALLATION DIRECTORY: /home/jarret/.gem/ruby/2.7.0
- RUBY EXECUTABLE: /usr/bin/ruby2.7
- GIT EXECUTABLE: /usr/bin/git
- EXECUTABLE DIRECTORY: /home/jarret/gems/bin
- SPEC CACHE DIRECTORY: /home/jarret/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /etc
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /home/jarret/gems
- /home/jarret/.gem/ruby/2.7.0
- /var/lib/gems/2.7.0
- /usr/lib/ruby/gems/2.7.0
- /usr/share/rubygems-integration/2.7.0
- /usr/share/rubygems-integration/all
- /usr/lib/x86_64-linux-gnu/rubygems-integration/2.7.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /home/jarret/gems/bin
- /home/jarret/miniconda3/condabin
- /usr/local/sbin
- /usr/local/bin
- /usr/sbin
- /usr/bin
- /sbin
- /bin
- /usr/games
- /usr/local/games
- /snap/bin
- /opt/fiji/Fiji.app
I've tried many remove/install, I've tried updated gem, ruby. Nothing unlocked me so far.
Try to replace ruby3.0, sass1.58 is too advanced and may not be compatible with ruby2.7.
Please follow these steps and run the command.
rvm install 3.0
rvm use 3.0.0 -default
rvm -v
rvm gemset update
gem install jekyll
jekyll -v
I am running OSX High Sierra.
I have a ruby script I'm attempting to run on OSX (it's an Avid validation tool, but I don't think that matters).
When I run it, I get the following output ( added the code to print the version and the gem path)
MacBook-Pro:DTT jon$ ./run_test.command -h -v
-----
Ruby Version : 2.5.0
Gem Path :
/Users/jon/.gem/ruby/2.5.0
/Users/jon/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0
-----
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- curses (LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/jon/Downloads/AAX_Tools_DSH_0p2p1x753_2/DTT/sources/DishTestTool.rb:21:in `<top (required)>'
from /Users/jon/Downloads/AAX_Tools_DSH_0p2p1x753_2/DTT/sources/bin/runsuite.rb:82:in `require_relative'
from /Users/jon/Downloads/AAX_Tools_DSH_0p2p1x753_2/DTT/sources/bin/runsuite.rb:82:in `<main>'
Note that it appears to be reading gems from version 2.3, but I am actually running 2.5.0
and if I do gem env, there is no sign of that 2.3 folder
MacBook-Pro:DTT jon$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 2.7.6
- RUBY VERSION: 2.5.0 (2017-12-25 patchlevel 0) [x86_64-darwin17]
- INSTALLATION DIRECTORY: /Users/jon/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0
- USER INSTALLATION DIRECTORY: /Users/jon/.gem/ruby/2.5.0
- RUBY EXECUTABLE: /Users/jon/.rbenv/versions/2.5.0/bin/ruby
- EXECUTABLE DIRECTORY: /Users/jon/.rbenv/versions/2.5.0/bin
- SPEC CACHE DIRECTORY: /Users/jon/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /Users/jon/.rbenv/versions/2.5.0/etc
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-17
- GEM PATHS:
- /Users/jon/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0
- /Users/jon/.gem/ruby/2.5.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /Users/jon/.rbenv/versions/2.5.0/bin
- /usr/local/Cellar/rbenv/1.1.1/libexec
- /Users/jon/.rbenv/shims
- /usr/local/bin
- /usr/bin
- /bin
- /usr/sbin
- /sbin
- /opt/local/bin
- /opt/X11/bin
I've tried installing ruby with rvm, then uninstalled it, removed rvm, installed it again with rbenv. Installing and updating gems (curses in particular), etc etc (I'm a newbie with ruby and moderately familiar with the workings of Unix systems, but no systems guru), but all to no avail.
Does anybody know how I get ruby to read the correct gems?
--------------- Edit ----------------
I've discovered cause of the issue
The ruby script run_test.command called another ruby script, with the line
system("#{ruby} \"#{runsuite_path.realpath}\" #{args}")
Where, crucially
ruby = '/usr/bin/ruby'
For some reason, updating ruby does not change the version of ruby executed with /usr/bin/ruby
changing that line to
ruby = '/usr/bin/env ruby'
Seems to fix the issue
Which begs two questions. Why is /usr/bin/ruby not changed to reflect the update, and can I change it manually without issues?
The ruby binary that is found at /usr/bin/ruby is the version of Ruby installed by MacOS and should be left alone. Homebrew, Chruby, RVM & RBEnv all will install rubies in different locations away from the base so that they don't overwrite it or change it. This is expected behaviour, as you don't know what could be depending on the system ruby, or what has been natively compiled against it.
I'm having an issue with homebrew looking to the system gems when the system gems aren't in the $PATH.
Here is my gem env to show that my gems are installed in my .rvm/gems directory:
RubyGems Environment:
- RUBYGEMS VERSION: 2.4.5
- RUBY VERSION: 2.2.2 (2015-04-13 patchlevel 95) [x86_64-darwin14]
- INSTALLATION DIRECTORY: /Users/scott/.rvm/gems/ruby-2.2.2
- RUBY EXECUTABLE: /usr/local/opt/ruby/bin/ruby
- EXECUTABLE DIRECTORY: /Users/scott/.rvm/gems/ruby-2.2.2/bin
- SPEC CACHE DIRECTORY: /Users/scott/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /usr/local/Cellar/ruby/2.2.2/etc
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-14
- GEM PATHS:
- /Users/scott/.rvm/gems/ruby-2.2.2
- /Users/scott/.rvm/gems/ruby-2.2.2#global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- :sources => ["http://gems.rubyforge.org/", "http://gems.github.com"]
- :benchmark => false
- "gem" => "--no-ri --no-rdoc"
- REMOTE SOURCES:
- http://gems.rubyforge.org/
- http://gems.github.com
- SHELL PATH:
- /Users/scott/.rvm/gems/ruby-2.2.2/bin
- /Users/scott/.rvm/gems/ruby-2.2.2#global/bin
- /Users/scott/.rvm/rubies/ruby-2.2.2/bin
- /usr/local/bin
- /usr/bin
- /bin
- /usr/sbin
- /sbin
- /opt/X11/bin
- /Users/scott/.rvm/bin
- /Users/scott/.composer/vendor/bin
- /usr/local/sbin
Now here is the error message I keep getting on various commands (this in particular was from brew services start httpd22):
Error: ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
Extracting libxml2-2.8.0.tar.gz into tmp/x86_64-apple-darwin14.3.0/ports/libxml2/2.8.0... OK
Running 'compile' for libxml2 2.8.0... ERROR, review 'tmp/x86_64-apple-darwin14.3.0/ports/libxml2/2.8.0/compile.log' to see what happened.
/Library/Ruby/Gems/2.0.0/gems/mini_portile-0.5.2/lib/mini_portile.rb:265:in `block in execute': Failed to complete compile task (RuntimeError)
from /Library/Ruby/Gems/2.0.0/gems/mini_portile-0.5.2/lib/mini_portile.rb:257:in `chdir'
from /Library/Ruby/Gems/2.0.0/gems/mini_portile-0.5.2/lib/mini_portile.rb:257:in `execute'
from /Library/Ruby/Gems/2.0.0/gems/mini_portile-0.5.2/lib/mini_portile.rb:69:in `compile'
from /Library/Ruby/Gems/2.0.0/gems/mini_portile-0.5.2/lib/mini_portile.rb:109:in `cook'
from extconf.rb:101:in `block in <main>'
from extconf.rb:119:in `call'
from extconf.rb:119:in `block in <main>'
from extconf.rb:109:in `tap'
from extconf.rb:109:in `<main>'
extconf failed, exit code 1
Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/nokogiri-1.6.1 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-14/2.0.0/nokogiri-1.6.1/gem_make.out
See how it's looking to the system version of Ruby & Gems? I have XCode installed and up to date.
brew doctor yields no results and brew update is ready to brew.
I'm using OS 10.10.3. Anything I've left out, just ask.
EDIT
Here is my .zshrc $PATH export:
export PATH="$PATH:$HOME/.composer/vendor/bin"
export PATH="$PATH:/usr/local/sbin"
export PATH="$PATH:$HOME/.rvm/bin"
EDIT 2
$GEM_HOME
/Users/scott/.rvm/gems/ruby-2.2.2
$GEM_PATH
/Users/scott/.rvm/gems/ruby-2.2.2:/Users/scott/.rvm/gems/ruby-2.2.2#global
Thoughts?
looking at brew:
https://github.com/Homebrew/homebrew/blob/master/bin/brew
https://github.com/Homebrew/homebrew/blob/master/bin/brew#L22
so brew is upsetting the GEM_PATH and doing its own thing.
Found the answer, the system rubygems.rb was referencing the wrong version of Ruby. More details here: https://github.com/Homebrew/homebrew/issues/31220
I am trying to do the heroku setup portion of the tutorial http://ruby.railstutorial.org/. But on https://toolbelt.heroku.com/, I noticed there isn't an .rpm for Fedora, so I tried to install Foreman and the Heroku CLI individually. Foreman and Git installed fine, but I'm having trouble with the Heroku CLI.
When I try to do:
$yum install rubygem-heroku
and then subsequently do simply
$heroku
I get the error:
/usr/share/rubygems/rubygems/dependency.rb:247:in `to_specs': Could not find heroku (>= 0) amongst [actionmailer-3.2.8, actionpack-3.2.8, activemodel-3.2.8, activerecord-3.2.8, activeresource-3.2.8, activesupport-3.2.8, addressable-2.3.2, arel-3.0.2, builder-3.0.4, builder-3.0.3, bundler-1.2.3, bundler-1.2.1, coffee-rails-3.2.2, coffee-script-2.2.0, coffee-script-source-1.4.0, coffee-script-source-1.3.3, erubis-2.7.0, excon-0.16.10, execjs-1.4.0, foreman-0.60.2, heroku-api-0.3.7, hike-1.2.1, i18n-0.6.1, journey-1.0.4, jquery-rails-2.1.4, jquery-rails-2.1.3, jquery-rails-2.0.2, json-1.7.5, launchy-2.1.2, libv8-3.3.10.4-x86_64-linux, mail-2.4.4, mime-types-1.19, multi_json-1.5.0, multi_json-1.3.6, netrc-0.7.7, polyglot-0.3.3, rack-1.4.1, rack-cache-1.2, rack-ssl-1.3.2, rack-test-0.6.2, rails-3.2.8, railties-3.2.8, rake-10.0.3, rake-0.9.2.2, rdoc-3.12, rest-client-1.6.7, rubygems-bundler-1.1.0, rubyzip-0.9.9, rvm-1.11.3.5, sass-3.2.3, sass-3.2.1, sass-rails-3.2.5, sprockets-2.1.3, sqlite3-1.3.6, sqlite3-1.3.5, therubyracer-0.10.2, thor-0.16.0, tilt-1.3.3, treetop-1.4.12, treetop-1.4.11, treetop-1.4.10, tzinfo-0.3.35, tzinfo-0.3.33, uglifier-1.3.0, uglifier-1.2.3, uglifier-1.0.3] (Gem::LoadError)
from /usr/share/rubygems/rubygems/dependency.rb:256:in `to_spec'
from /usr/share/rubygems/rubygems.rb:1231:in `gem'
from /usr/bin/heroku:18:in `<main>'
So I yum removed it and tried to instead do:
$rvmsudo gem install heroku
Now when I run heroku, I get:
/usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- readline (LoadError)
from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/local/rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/heroku-2.33.5/lib/heroku/command/run.rb:1:in `<top (required)>'
from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/local/rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/heroku-2.33.5/lib/heroku/command.rb:14:in `block in load'
from /usr/local/rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/heroku-2.33.5/lib/heroku/command.rb:13:in `each'
from /usr/local/rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/heroku-2.33.5/lib/heroku/command.rb:13:in `load'
from /usr/local/rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/heroku-2.33.5/lib/heroku/cli.rb:27:in `start'
from /usr/local/rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/heroku-2.33.5/bin/heroku:17:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/bin/heroku:19:in `load'
from /usr/local/rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/bin/heroku:19:in `<main>'
from /usr/local/rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/bin/ruby_noexec_wrapper:14:in `eval'
from /usr/local/rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/bin/ruby_noexec_wrapper:14:in `<main>'
Trying rvm info yields
ruby-1.9.3-p194#rails3tutorial2ndEd:
system:
uname: "Linux angelo 3.6.5-1.fc17.x86_64 #1 SMP Wed Oct 31 19:37:18 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux"
system: "redhat/17./x86_64"
bash: "/usr/bin/bash => GNU bash, version 4.2.37(1)-release (x86_64-redhat-linux-gnu)"
zsh: " => not installed"
rvm:
version: "rvm 1.16.6 (master) by Wayne E. Seguin <wayneeseguin#gmail.com>, Michal Papis <mpapis#gmail.com> [https://rvm.io/]"
updated: "2 months 20 days 1 hour 33 minutes 52 seconds ago"
ruby:
interpreter: "ruby"
version: "1.9.3p194"
date: "2012-04-20"
platform: "x86_64-linux"
patchlevel: "2012-04-20 revision 35410"
full_version: "ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]"
homes:
gem: "/usr/local/rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd"
ruby: "/usr/local/rvm/rubies/ruby-1.9.3-p194"
binaries:
ruby: "/usr/local/rvm/rubies/ruby-1.9.3-p194/bin/ruby"
irb: "/usr/local/rvm/rubies/ruby-1.9.3-p194/bin/irb"
gem: "/usr/local/rvm/rubies/ruby-1.9.3-p194/bin/gem"
rake: "/usr/local/rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/bin/rake"
environment:
PATH: "/home/angelo/.rvm/bin:/usr/local/rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/bin:/usr/local/rvm/gems/ruby-1.9.3-p194#global/bin:/usr/local/rvm/rubies/ruby-1.9.3-p194/bin:/usr/local/rvm/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/home/angelo/heroku-client/:/home/angelo/.local/bin:/home/angelo/bin"
GEM_HOME: "/usr/local/rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd"
GEM_PATH: "/usr/local/rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd:/usr/local/rvm/gems/ruby-1.9.3-p194#global"
MY_RUBY_HOME: "/usr/local/rvm/rubies/ruby-1.9.3-p194"
IRBRC: "/usr/local/rvm/rubies/ruby-1.9.3-p194/.irbrc"
RUBYOPT: ""
gemset: "rails3tutorial2ndEd"
And my rails version
$ rails -v
Rails 3.2.8
Gem env:
$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.24
- RUBY VERSION: 1.9.3 (2012-04-20 patchlevel 194) [x86_64-linux]
- INSTALLATION DIRECTORY: /usr/local/rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd
- RUBY EXECUTABLE: /usr/local/rvm/rubies/ruby-1.9.3-p194/bin/ruby
- EXECUTABLE DIRECTORY: /usr/local/rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /usr/local/rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd
- /usr/local/rvm/gems/ruby-1.9.3-p194#global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
I am pretty new to this whole ruby (as well as heroku), so I'm not sure what I should be looking for to match up, but everything seems to be ruby-1.9.3, so I am confused as to why Heroku doesn't want to cooperate.
There is also a stand alone version of the toolbelt now available at https://toolbelt.heroku.com/standalone.
I rather used the heroku and the foreman gem than using the heroku tool bet on fedora 17/18.
gem install heroku
gem install foreman
during installation it will give a warning saying
The heroku gem has been deprecated and replaced with the Heroku Toolbelt.
Ignore that. The toolbet even gave me problems on windows system.
All else works fine on Fedora 17/18.
Enjoy Rubying!
I did
sudo yum install rubygem-heroku
If you are using RVM, do this
rvm use system
use heroku client.
Had a hard time making heroku command work with rvm+jruby
You should totality go for the standalone option which is way more stable.
I had the gem installed as well and I got into a lot type of errors (ssl, cert, yours...)
You can go to:
https://toolbelt.heroku.com/standalone
and install it depending on your OS.
Hope this helps
If you install the rubygem_heroku package, it likely installs the gem in the system ruby.
Based on your examples, you're using RVM.
You should install the heroku gem directly into the RVM environment and gemset you want to use it in:
gem install heroku
I've installed the development version of Crunchbang, a linux distro based off Debian. I got Ruby and Rubygems installed, but I can't get the gems I've installed to load. Here is a command-line session:
$ ruby -v
ruby 1.9.1p378 (2010-01-10 revision 26273) [i486-linux]
$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.6
- RUBY VERSION: 1.9.1 (2010-01-10 patchlevel 378) [i486-linux]
- INSTALLATION DIRECTORY: /usr/lib/ruby1.9.1/gems/1.9.1
- RUBY EXECUTABLE: /usr/bin/ruby1.9.1
- EXECUTABLE DIRECTORY: /usr/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-linux
- GEM PATHS:
- /usr/lib/ruby1.9.1/gems/1.9.1
- /home/corey/.gem/ruby/1.9.1
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
$ echo $PATH
/home/corey/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games:/home/corey/.gem/ruby/1.9.1:/usr/lib/ruby1.9.1/gems/1.9.1
$ gem list -d nokogiri
`*** LOCAL GEMS ***`
nokogiri (1.4.1)
Authors: Aaron Patterson, Mike Dalessio
Rubyforge: http://rubyforge.org/projects/nokogiri
Homepage: http://nokogiri.org
Installed at: /usr/lib/ruby1.9.1/gems/1.9.1
Nokogiri (鋸) is an HTML, XML, SAX, and Reader parser
$ ruby -r rubygems -e "require 'nokogiri'"
-e:1:in `require': no such file to load -- nokogiri (LoadError)
from -e:1:in `'
I've encountered similar problems on Ubuntu before, but they were easy to fix. I can't figure out what's wrong in this particular case, and Google didn't seem to know either. Any help would be greatly appreciated!
By the way... this is my first submission to stackoverflow. I hope this question is relevant. :)
Debian does not load RubyGems by default. You can solve this by adding require 'rubygems' to your code or better still, have RubyGems loaded each time Ruby is run. I also run #! and achieved this by editing my ~/.profile adding export RUBYOPT=rubygems and finally reloading my profile with . ~/.profile.
For more information on this matter see: http://docs.rubygems.org/read/chapter/3
Is nokogiri in any of the directories in GEM PATHS?
I've had problems before with installing rubygems from the Debian repos and then installing in manually. Debian puts all gems in /var/ somewhere in the distribution package.