`require': no such file to load -- rubygems

wolf_volpi's Avatar

wolf_volpi

13 Sep, 2010 01:45 AM

I am new to gems. Do you see a way to fix the "no such file to load -- rubygems" load error?

Here is the error in action:
$ spec --format specdoc note_spec.rb
./spec_helper.rb:10:in `require': no such file to load -- rubygems (LoadError)

Line 10 of spec_helper.rb file is:
require 'rubygems'

I am running Jruby 1.4.0 on Ubuntu 10.4. Before I installed Jruby, I was running Ruby 1.9, which has since been removed.
The following is every relevant diagnostic I could think of:

/usr/lib/jruby/lib/ruby/site_ruby/1.8$ ls
gauntlet_rubygems.rb rbconfig rubygems.rb
gemconfigure.rb rubygems ubygems.rb

$ which rubygems.rb
<empty>

$ which rubygems
<empty>

$ jirb
>> require 'rubygems'
=> true
>> $:.each { |d| puts d}
/usr/lib/jruby//lib/ruby/site_ruby/1.8
/usr/lib/jruby//lib/ruby/site_ruby/shared
/usr/lib/jruby//lib/ruby/1.8
.
=> ...
>> exit

$ jruby -v
jruby 1.4.0 (ruby 1.8.7 patchlevel 174) (2010-02-11 6586) (OpenJDK Client VM 1.6.0_18) [i386-java]

$ ruby -v
The program 'ruby' is currently not installed.

$ gem env
The program 'gem' can be found in the following packages:
* rubygems1.8
* rubygems1.9.1
Try: sudo apt-get install <selected package>

Thank you.

  1. 1 Posted by wolf_volpi on 19 Sep, 2010 08:37 PM

    wolf_volpi's Avatar

    Problem solved, all it needed was two more gems:

    $ sudo jruby -S gem install rspec
    $ sudo jruby -S gem install hpricot

  2. wolf_volpi closed this discussion on 19 Sep, 2010 08:38 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

30 Oct, 2014 04:34 PM
30 Oct, 2014 02:46 PM
28 Oct, 2014 09:51 AM
23 Oct, 2014 05:37 PM
21 Oct, 2014 10:47 AM