Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rvm, irb and require - not working for installed gems under irb

Tags:

ruby

rvm

gem

irb

I have just installed rvm today and it looks really handy/powerful.

I think I am getting the hang of it, but...

When using an rvm installed ruby, and running irb, when I require an installed gem, something, like 'rvm', I get:

> kimptoc$ rvm use 1.8.7
Using /Users/kimptoc/.rvm/gems/ruby-1.8.7-p302


> kimptoc$ gem list

*** LOCAL GEMS ***

abstract (1.0.0)
...
rvm (1.0.11)
...


> kimptoc$ irb
ruby-1.8.7-p302 > require 'rvm'
LoadError: no such file to load -- rvm
    from (irb):1:in `require'
    from (irb):1

But when using the "system" ruby, it works fine.

Historically I have been using sudo gem install ... and so the "system" gems are generally installed that way. Could that be my problem? Do I need to uninstall these to fix things?

I am running OSX 10.6.4. "system" is the default OSX ruby, 1.8.7 (p174)

Thanks in advance for any tips/thoughts, Chris

like image 467
Chris Kimpton Avatar asked Dec 13 '22 19:12

Chris Kimpton


1 Answers

Try require 'rubygems' first.

like image 160
Arkku Avatar answered Mar 08 '23 11:03

Arkku