on ubuntu, ruby can't find the gems

Discussion in 'Ruby' started by Dave Cottingham, Aug 16, 2008.

  1. I'm working on Ubuntu 7.10, which presumably does things the Debian way.
    I have loaded several gems without apparent problem, and I see them
    sitting there in /var/lib/gems/1.8, which I understand is the Debian
    place for them. But when I try to use one of them in ruby, e.g. if I
    say

    require 'image_science'

    it says

    -:1:in `require': no such file to load -- image_science (LoadError)
    from -:1

    So ruby apparently doesn't know to look for them there. I've tried
    defining RUBYLIB to '/var/lib/gems/1.8' or '/var/lib/gems/1.8/gems' or
    /var/lib/gems' with no improvement.

    So my question is, how is ruby supposed to find the gems?

    BTW I got ruby and gem by apt-get, so it's a little surprising that they
    aren't configured to play with each other.
    --
    Posted via http://www.ruby-forum.com/.
     
    Dave Cottingham, Aug 16, 2008
    #1
    1. Advertising

  2. Phlip wrote:
    > require 'rubygems'
    >
    >> require 'image_science'

    >
    > ?


    "require 'rubygems'" works; rubygems of course was not installed by gem,
    and it's in the main ruby library, which on my machine is in
    /usr/lib/ruby/1.8.

    The stuff my ruby can't find are the packages that were installed by
    gem.
    --
    Posted via http://www.ruby-forum.com/.
     
    Dave Cottingham, Aug 16, 2008
    #2
    1. Advertising

  3. Dave Cottingham

    Serabe Guest

    I think that what Phlip really meant is that you should require
    rubygems before requiring a gem. Example:

    require 'rubygems'
    require 'image_science'

    Cheers,

    Serabe

    --
    http://www.serabe.com
     
    Serabe, Aug 16, 2008
    #3
  4. Serabe wrote:
    > I think that what Phlip really meant is that you should require
    > rubygems before requiring a gem. Example:
    >
    > require 'rubygems'
    > require 'image_science'
    >
    > Cheers,
    >
    > Serabe


    Ahh. Sorry I was being thickheaded. Yes, that solves the problem.

    Thanks for the help.
    --
    Posted via http://www.ruby-forum.com/.
     
    Dave Cottingham, Aug 17, 2008
    #4
    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. SPE - Stani's Python Editor
    Replies:
    1
    Views:
    471
    SPE - Stani's Python Editor
    Apr 29, 2008
  2. Christoph Sturm

    problem installing gems on ubuntu amd64

    Christoph Sturm, Feb 3, 2005, in forum: Ruby
    Replies:
    4
    Views:
    117
  3. Max Williams
    Replies:
    12
    Views:
    341
    Max Williams
    Jul 13, 2008
  4. Alex 2k8

    Can't uninstall gems on Ubuntu

    Alex 2k8, May 27, 2009, in forum: Ruby
    Replies:
    6
    Views:
    227
    Eric Hodel
    May 30, 2009
  5. Santosh Dvn
    Replies:
    13
    Views:
    197
    Santosh Dvn
    Jun 3, 2010
Loading...

Share This Page