tags:

views:

43

answers:

2

Hi,

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

+1  A: 

Try require 'rubygems' first.

Arkku
Many Thanks, that did the trick. Must find out what 'rubygems' gives, seems like some kind of base tools.
Chris Kimpton
+1  A: 
> rvm use 1.8.7
> rvm info
     (Find the homes -> gem directory)
> ls -al ~/.rvm/gems/ruby-1.8.7   (Substitute your gem directory as needed)

Is your gem in this directory?

Generally speaking, using sudo gem install with rvm is a bad idea.

Jason Noble
Thanks - I was missing the require 'rubygems' call. It seems I had missed this previously, I guess Rails does this for me under the covers :)
Chris Kimpton