5

I have spent literally days trying to install ruby 1.9.2 and get it working with gems :-/ I eventually gave up on my Mac OSX 10.6 machine and below is the current state on my Ubuntu machine. Any advice would be greatly appreciated!

# ruby test.rb <internal:lib/rubygems/custom_require>:29:in `require': no such file to load -- mongo (LoadError) from <internal:lib/rubygems/custom_require>:29:in `require' from test.rb:1:in `<main>' # cat test.rb require 'mongo' db = Mongo::Connection.new.db("mydb") # gem which mongo /usr/local/rvm/gems/ruby-1.9.2-p0/gems/mongo-1.1.2/lib/mongo.rb # cat /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=10.10 DISTRIB_CODENAME=maverick DISTRIB_DESCRIPTION="Ubuntu 10.10" 

According to this page: http://docs.rubygems.org/read/chapter/19 I symlinked which ruby I was using to match that which gem is using:

# which ruby /usr/local/rvm/bin/ruby # ls -l `which ruby` lrwxrwxrwx 1 root root 44 2010-11-17 13:25 /usr/local/rvm/bin/ruby -> /usr/local/rvm/rubies/ruby-1.9.2-p0/bin/ruby # gem env | grep 'RUBY EXECUTABLE' - RUBY EXECUTABLE: /usr/local/rvm/rubies/ruby-1.9.2-p0/bin/ruby # which gem /usr/local/rvm/bin/gem # gem -v 1.3.7 # ruby -v ruby 1.9.2p0 (2010-08-18 revision 29036) [i686-linux] 
1
  • I'm sorry, I'm not familiar with the word. Is this what you mean: en.wikipedia.org/wiki/Gadol ? Commented Nov 17, 2010 at 19:00

5 Answers 5

6

Try putting the following line at the beginning

require "rubygems" 
Sign up to request clarification or add additional context in comments.

1 Comment

That's not needed in Ruby 1.9.2, which he's running.
2

Why is "rvm" displaying in your /usr/local/rvm/ path? Did you do a system-wide install, as a system administrator using administering Ruby system wide for multiple users?

Did you add [[ -s '/usr/local/lib/rvm' ]] && source '/usr/local/lib/rvm' to your ~/.bashrc, ~/.bash_profile or ~/.profile (whichever you have configured)?

For normal, every day use, I recommend RVM's default setup: RVM installation, RVM gems management.

Note to self: Buy stock in RVM. It's too cool.

Comments

1

Does it work under Ruby 1.8.7, which is pre-installed by default on OS X?

If so, one difference between 1.9.1 and 1.9.2 is that "." isn't part of $:'s path any more.

Comments

1

I recommend that you do rvm implode and delete the current setup. Then use the railsready script to setup RVM and Ruby properly for you on Ubuntu. It's important to understand that until you know what you are doing you should run the script as a user. Hope that helps.

Comments

0

On linux and OS X, I have always had to put require "rubygems" in the beginning. However it has always worked fine without this line on windows.

1 Comment

require rubygems was needed in Ruby < 1.9. It's now done automatically in 1.9+.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.