Gems installed to $HOME not recognized

Discussion in 'Ruby' started by Albert Schlef, Apr 2, 2010.

  1. I'm using Ruby 1.9, Ubuntu (I don't have the following problem with my
    Ruby 1.8).

    For some reason, Ruby 1.9 doesn't see gems I install to $HOME. It only
    sees gems I install as root.

    In other words, if I do the following...

    $ gem1.9.1 install haml

    ...the gem gets installed in ~/.gem/ruby/1.9.1/gems/haml-2.2.22, and
    when I do 'require "haml"' ruby says there's no such file to load.

    On the other hand, when I do....

    $ sudo gem1.9.1 install haml

    ...the gem gets installed in /var/lib/gems/1.9.1/gems/haml-2.2.22, and
    doing 'require "haml"' works.

    I temporarily solved the problem by symlinking /var/lib/gems/1.9.1 to
    ~/.gem/ruby/1.9.1.

    My question:

    How can i make Ruby 1.9 see the gems installed at ~/.gem/ruby/1.9.1 ?
    --
    Posted via http://www.ruby-forum.com/.
     
    Albert Schlef, Apr 2, 2010
    #1
    1. Advertising

  2. [Note: parts of this message were removed to make it a legal post.]

    I found that it was a lot of hassle trying to get Ruby1.9 setup on Ubuntu,
    particularly if you wanted to switch between 1.8 and 1.9.

    Then I found rvm http://rvm.beginrescueend.com/ which has made the whole
    process very easy to manage. I removed all my ruby packages except for 1.8
    and gems then followed the installation instructions for rvm using the gem
    method.

    Hope it helps you!

    On Fri, Apr 2, 2010 at 12:31 PM, Albert Schlef <>wrote:

    > I'm using Ruby 1.9, Ubuntu (I don't have the following problem with my
    > Ruby 1.8).
    >
    > For some reason, Ruby 1.9 doesn't see gems I install to $HOME. It only
    > sees gems I install as root.
    >
    > In other words, if I do the following...
    >
    > $ gem1.9.1 install haml
    >
    > ...the gem gets installed in ~/.gem/ruby/1.9.1/gems/haml-2.2.22, and
    > when I do 'require "haml"' ruby says there's no such file to load.
    >
    > On the other hand, when I do....
    >
    > $ sudo gem1.9.1 install haml
    >
    > ...the gem gets installed in /var/lib/gems/1.9.1/gems/haml-2.2.22, and
    > doing 'require "haml"' works.
    >
    > I temporarily solved the problem by symlinking /var/lib/gems/1.9.1 to
    > ~/.gem/ruby/1.9.1.
    >
    > My question:
    >
    > How can i make Ruby 1.9 see the gems installed at ~/.gem/ruby/1.9.1 ?
    > --
    > Posted via http://www.ruby-forum.com/.
    >
    >
     
    Andrew Theaker, Apr 7, 2010
    #2
    1. Advertising

  3. I had the same problem on Ubuntu 9.10. Setting the environment
    variable GEM_HOME to the location of my gems seems to work.

    On Fri, Apr 2, 2010 at 1:31 AM, Albert Schlef <> wrot=
    e:
    > I'm using Ruby 1.9, Ubuntu (I don't have the following problem with my
    > Ruby 1.8).
    >
    > For some reason, Ruby 1.9 doesn't see gems I install to $HOME. It only
    > sees gems I install as root.
    >
    > In other words, if I do the following...
    >
    > =A0$ gem1.9.1 install haml
    >
    > ...the gem gets installed in ~/.gem/ruby/1.9.1/gems/haml-2.2.22, and
    > when I do 'require "haml"' ruby says there's no such file to load.
    >
    > On the other hand, when I do....
    >
    > =A0$ sudo gem1.9.1 install haml
    >
    > ...the gem gets installed in /var/lib/gems/1.9.1/gems/haml-2.2.22, and
    > doing 'require "haml"' works.
    >
    > I temporarily solved the problem by symlinking /var/lib/gems/1.9.1 to
    > ~/.gem/ruby/1.9.1.
    >
    > My question:
    >
    > How can i make Ruby 1.9 see the gems installed at ~/.gem/ruby/1.9.1 ?
    > --
    > Posted via http://www.ruby-forum.com/.
    >
    >




    --=20
    Jesper
     
    Jesper Fruergaard Andersen, Apr 13, 2010
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. bwv549
    Replies:
    2
    Views:
    181
    bwv549
    Nov 11, 2005
  2. Nigama Xx
    Replies:
    1
    Views:
    94
    Sebastian Hungerecker
    Dec 12, 2007
  3. Matthew Williams
    Replies:
    2
    Views:
    192
    Matthew Williams
    Jan 6, 2008
  4. Nikolai Lugovoi
    Replies:
    0
    Views:
    128
    Nikolai Lugovoi
    Mar 17, 2010
  5. L. D. James

    Perl's installed module isn't recognized

    L. D. James, Mar 14, 2008, in forum: Perl Misc
    Replies:
    3
    Views:
    157
    L. D. James
    Mar 14, 2008
Loading...

Share This Page