Ruby cannot find required libraries, even if gem is installed

I spent literally days trying to install ruby ​​1.9.2 and make it work with precious stones: - / In the end, I abandoned my Mac OSX machine 10.6 and below - 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 indicated which ruby ​​I used to match the one that uses the stone:

# 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]
+5
source share
5 answers

"rvm" /usr/local/rvm/? , , Ruby ?

[[ -s '/usr/local/lib/rvm' ]] && source '/usr/local/lib/rvm' ~/.bashrc, ~/.bash_profile ~/.profile ( , )?

RVM: RVM, RVM.

: RVM. .

+2

require "rubygems"
+6

Ruby 1.8.7, OS X?

, 1.9.1 1.9.2 , "." $:.

+1

rvm implode . railsready script, RVM Ruby Ubuntu. , , , , script . , .

+1

linux OS X "rubygems" . , .

0

All Articles