building ruby from source

Discussion in 'Ruby' started by Rajinder Yadav, Dec 27, 2009.

  1. I removed my older ruby package from my ubuntu, built ruby from source
    successfully. added the sym link from ruby1.8 -> ruby in /usr/bin/

    however from the IRB I'm getting errors it can't find my gems? how do I
    fix this, I assume I need to define some environment variables?


    irb(main):003:0> require 'rubygems'
    LoadError: no such file to load -- rubygems
    from (irb):3:in `require'
    from (irb):3
    from :0
    irb(main):004:0> require 'grackle'
    LoadError: no such file to load -- grackle
    from (irb):4:in `require'
    from (irb):4
    from :0

    --
    Kind Regards,
    Rajinder Yadav

    http://DevMentor.org

    Do Good! - Share Freely
    Rajinder Yadav, Dec 27, 2009
    #1
    1. Advertising

  2. On 27.12.2009 05:12, Rajinder Yadav wrote:
    > I removed my older ruby package from my ubuntu, built ruby from source
    > successfully. added the sym link from ruby1.8 -> ruby in /usr/bin/
    >
    > however from the IRB I'm getting errors it can't find my gems? how do I
    > fix this, I assume I need to define some environment variables?


    http://docs.rubygems.org/read/chapter/3

    You need to install RubyGems.

    --
    Phillip Gawlowski
    Phillip Gawlowski, Dec 27, 2009
    #2
    1. Advertising

  3. Phillip Gawlowski wrote:
    > On 27.12.2009 05:12, Rajinder Yadav wrote:
    >> I removed my older ruby package from my ubuntu, built ruby from source
    >> successfully. added the sym link from ruby1.8 -> ruby in /usr/bin/
    >>
    >> however from the IRB I'm getting errors it can't find my gems? how do I
    >> fix this, I assume I need to define some environment variables?

    >
    > http://docs.rubygems.org/read/chapter/3
    >
    > You need to install RubyGems.
    >
    > --
    > Phillip Gawlowski
    >
    >


    I already had gems installed? are you telling me I got to repeat the
    entire process to install gem and then all the gem packages?

    yadav@KubuntuX64:$ gem list

    *** LOCAL GEMS ***

    actionmailer (2.3.5)
    actionpack (2.3.5)
    activerecord (2.3.5)
    activeresource (2.3.5)
    activesupport (2.3.5)
    cgi_multipart_eof_fix (2.5.0)
    curb (0.6.0.0)
    daemons (1.0.10)
    fastthread (1.0.7)
    gem_plugin (0.2.3)
    grackle (0.1.7)
    haml (2.2.15)
    haml-edge (2.3.100)
    hpricot (0.8.2)
    json (1.2.0)
    mechanize (0.9.3)
    mime-types (1.16)
    mongrel (1.1.5)
    nokogiri (1.4.1)
    oauth (0.3.6)
    patron (0.4.4)
    rack (1.0.1)
    rails (2.3.5)
    rake (0.8.7)
    ruby-hmac (0.3.2)
    sqlite3-ruby (1.2.5)


    --
    Kind Regards,
    Rajinder Yadav

    http://DevMentor.org

    Do Good! - Share Freely
    Rajinder Yadav, Dec 27, 2009
    #3
  4. You can try to add the path to your current gems:

    export PATH=3D/var/lib/gems/1.8/bin:$PATH
    See:

    https://help.ubuntu.com/community/RubyOnRails#Installing RubyGems

    On Dec 26, 2009, at 11:22 PM, Rajinder Yadav wrote:

    > Phillip Gawlowski wrote:
    >> On 27.12.2009 05:12, Rajinder Yadav wrote:
    >>> I removed my older ruby package from my ubuntu, built ruby from =

    source
    >>> successfully. added the sym link from ruby1.8 -> ruby in /usr/bin/
    >>>=20
    >>> however from the IRB I'm getting errors it can't find my gems? how =

    do I
    >>> fix this, I assume I need to define some environment variables?

    >> http://docs.rubygems.org/read/chapter/3
    >> You need to install RubyGems.
    >> --=20
    >> Phillip Gawlowski

    >=20
    > I already had gems installed? are you telling me I got to repeat the =

    entire process to install gem and then all the gem packages?
    >=20
    > yadav@KubuntuX64:$ gem list
    >=20
    > *** LOCAL GEMS ***
    >=20
    > actionmailer (2.3.5)
    > actionpack (2.3.5)
    > activerecord (2.3.5)
    > activeresource (2.3.5)
    > activesupport (2.3.5)
    > cgi_multipart_eof_fix (2.5.0)
    > curb (0.6.0.0)
    > daemons (1.0.10)
    > fastthread (1.0.7)
    > gem_plugin (0.2.3)
    > grackle (0.1.7)
    > haml (2.2.15)
    > haml-edge (2.3.100)
    > hpricot (0.8.2)
    > json (1.2.0)
    > mechanize (0.9.3)
    > mime-types (1.16)
    > mongrel (1.1.5)
    > nokogiri (1.4.1)
    > oauth (0.3.6)
    > patron (0.4.4)
    > rack (1.0.1)
    > rails (2.3.5)
    > rake (0.8.7)
    > ruby-hmac (0.3.2)
    > sqlite3-ruby (1.2.5)
    >=20
    >=20
    > --=20
    > Kind Regards,
    > Rajinder Yadav
    >=20
    > http://DevMentor.org
    >=20
    > Do Good! - Share Freely
    >=20
    Rilindo Foster, Dec 27, 2009
    #4
  5. On 27.12.2009 05:22, Rajinder Yadav wrote:

    > I already had gems installed? are you telling me I got to repeat the
    > entire process to install gem and then all the gem packages?


    Apparently, if your compiled-from source Ruby cannot find "rubygems". ;)

    Most likely, installing RubyGems should be enough.

    How did you remove Ruby? Using apt-get? Which options? Or by other means?

    --
    Phillip Gawlowski
    Phillip Gawlowski, Dec 27, 2009
    #5
  6. Rilindo Foster wrote:
    > You can try to add the path to your current gems:
    >
    > export PATH=/var/lib/gems/1.8/bin:$PATH
    > See:


    unfortunately that doesn't seem to fix the issue

    > https://help.ubuntu.com/community/RubyOnRails#Installing RubyGems
    >
    > On Dec 26, 2009, at 11:22 PM, Rajinder Yadav wrote:
    >
    >> Phillip Gawlowski wrote:
    >>> On 27.12.2009 05:12, Rajinder Yadav wrote:
    >>>> I removed my older ruby package from my ubuntu, built ruby from source
    >>>> successfully. added the sym link from ruby1.8 -> ruby in /usr/bin/
    >>>>
    >>>> however from the IRB I'm getting errors it can't find my gems? how do I
    >>>> fix this, I assume I need to define some environment variables?
    >>> http://docs.rubygems.org/read/chapter/3
    >>> You need to install RubyGems.
    >>> --
    >>> Phillip Gawlowski

    >> I already had gems installed? are you telling me I got to repeat the entire process to install gem and then all the gem packages?
    >>
    >> yadav@KubuntuX64:$ gem list
    >>
    >> *** LOCAL GEMS ***
    >>
    >> actionmailer (2.3.5)
    >> actionpack (2.3.5)
    >> activerecord (2.3.5)

    (truncalted)

    --
    Kind Regards,
    Rajinder Yadav

    http://DevMentor.org

    Do Good! - Share Freely
    Rajinder Yadav, Dec 27, 2009
    #6
  7. Phillip Gawlowski wrote:
    > On 27.12.2009 05:22, Rajinder Yadav wrote:
    >
    >> I already had gems installed? are you telling me I got to repeat the
    >> entire process to install gem and then all the gem packages?

    >
    > Apparently, if your compiled-from source Ruby cannot find "rubygems". ;)
    >
    > Most likely, installing RubyGems should be enough.
    >
    > How did you remove Ruby? Using apt-get? Which options? Or by other means?


    sudo aptitude remove ruby

    >
    > --
    > Phillip Gawlowski
    >
    >



    --
    Kind Regards,
    Rajinder Yadav

    http://DevMentor.org

    Do Good! - Share Freely
    Rajinder Yadav, Dec 27, 2009
    #7
  8. Rilindo Foster wrote:
    > You can try to add the path to your current gems:
    >
    > export PATH=/var/lib/gems/1.8/bin:$PATH
    > See:


    is there another location rubygems can be install? I did an ls and found
    the following entries. should there not be more stuff here bases on my
    gem list showing??

    yadav@KubuntuX64:$ ls -l
    total 20
    -rwxr-xr-x 1 root root 349 2009-11-30 02:36 gpgen
    -rwxr-xr-x 1 root root 351 2009-11-30 02:49 mongrel_rails
    -rwxr-xr-x 1 root root 338 2009-11-30 01:09 rackup
    -rwxr-xr-x 1 root root 339 2009-11-30 01:09 rails
    -rwxr-xr-x 1 root root 336 2009-11-30 01:08 rake


    > https://help.ubuntu.com/community/RubyOnRails#Installing RubyGems
    >
    > On Dec 26, 2009, at 11:22 PM, Rajinder Yadav wrote:
    >
    >> Phillip Gawlowski wrote:
    >>> On 27.12.2009 05:12, Rajinder Yadav wrote:
    >>>> I removed my older ruby package from my ubuntu, built ruby from source
    >>>> successfully. added the sym link from ruby1.8 -> ruby in /usr/bin/
    >>>>
    >>>> however from the IRB I'm getting errors it can't find my gems? how do I
    >>>> fix this, I assume I need to define some environment variables?
    >>> http://docs.rubygems.org/read/chapter/3
    >>> You need to install RubyGems.
    >>> --
    >>> Phillip Gawlowski

    >> I already had gems installed? are you telling me I got to repeat the entire process to install gem and then all the gem packages?
    >>
    >> yadav@KubuntuX64:$ gem list
    >>
    >> *** LOCAL GEMS ***
    >>
    >> actionmailer (2.3.5)
    >> actionpack (2.3.5)
    >> activerecord (2.3.5)

    (truncated)

    --
    Kind Regards,
    Rajinder Yadav

    http://DevMentor.org

    Do Good! - Share Freely
    Rajinder Yadav, Dec 27, 2009
    #8
  9. On 27.12.2009 05:50, Rajinder Yadav wrote:
    > Phillip Gawlowski wrote:
    >> On 27.12.2009 05:22, Rajinder Yadav wrote:
    >>
    >>> I already had gems installed? are you telling me I got to repeat the
    >>> entire process to install gem and then all the gem packages?

    >>
    >> Apparently, if your compiled-from source Ruby cannot find "rubygems". ;)
    >>
    >> Most likely, installing RubyGems should be enough.
    >>
    >> How did you remove Ruby? Using apt-get? Which options? Or by other means?

    >
    > sudo aptitude remove ruby


    Right, I'm a little foggy here (It's been a while since I last touched
    any from of *NIX).

    However, it seems that you now have a rather curious state for your Ruby.

    For one, Ruby is split into several packages (ruby, irb, ruby-dev,
    libruby, ri; off the top of my head), and a couple of Ruby packages
    exit, too, most famously RubyGems.

    However, each distribution (more or less), tweaks their offered packages
    to conform to the distribution's file system layout.

    These tweaks are not necessarily identical to what a build from source
    provides.

    So, it seems that your Ruby install is in an inconsistent state, where
    Ruby, and RubyGems don't "know" about each other, since they use
    different directories.

    A solution would be to do a "sudo aptitude remove ruby*" to remove
    anything the distro installed, re-do "sudo make install" in your Ruby
    source directory, and then install RubyGems and your desired gems (it
    might be enough to monitor the filesystem, and see which directories
    "make install" and the RubyGems install create, and to copy your gems
    into this new directory.

    Or:

    You remove compiled-Ruby with the hopefully existing "make uninstall",
    and then reinstall Ruby from Ubuntu's repositories, and hope that fixes
    everything (it should).

    Aside: A tool I found handy when installing from source is Checkinstall:
    http://checkinstall.izto.org/ allowing to introduce software compiled
    from source to a distribution's packet management system. :)

    --
    Phillip Gawlowski
    Phillip Gawlowski, Dec 27, 2009
    #9
  10. On 27.12.2009 05:55, Rajinder Yadav wrote:
    > Rilindo Foster wrote:
    >> You can try to add the path to your current gems:
    >>
    >> export PATH=/var/lib/gems/1.8/bin:$PATH
    >> See:

    >
    > is there another location rubygems can be install? I did an ls and found
    > the following entries. should there not be more stuff here bases on my
    > gem list showing??


    As many possibilities as there are Linux distributions. ;)

    Usually, it is "/[var|opt]/lib/ruby/1.8/gems/". The particulars depend
    on your distribution.

    --
    Phillip Gawlowski
    Phillip Gawlowski, Dec 27, 2009
    #10
  11. Phillip Gawlowski wrote:
    > On 27.12.2009 05:55, Rajinder Yadav wrote:
    >> Rilindo Foster wrote:
    >>> You can try to add the path to your current gems:
    >>>
    >>> export PATH=/var/lib/gems/1.8/bin:$PATH
    >>> See:

    >>
    >> is there another location rubygems can be install? I did an ls and found
    >> the following entries. should there not be more stuff here bases on my
    >> gem list showing??

    >
    > As many possibilities as there are Linux distributions. ;)
    >
    > Usually, it is "/[var|opt]/lib/ruby/1.8/gems/". The particulars depend
    > on your distribution.


    I've given up the battle and reinstalling rubygems ;)

    > --
    > Phillip Gawlowski
    >
    >



    --
    Kind Regards,
    Rajinder Yadav

    http://DevMentor.org

    Do Good! - Share Freely
    Rajinder Yadav, Dec 27, 2009
    #11
  12. Phillip Gawlowski wrote:
    > On 27.12.2009 05:50, Rajinder Yadav wrote:
    >> Phillip Gawlowski wrote:
    >>> On 27.12.2009 05:22, Rajinder Yadav wrote:
    >>>
    >>>> I already had gems installed? are you telling me I got to repeat the
    >>>> entire process to install gem and then all the gem packages?
    >>>
    >>> Apparently, if your compiled-from source Ruby cannot find "rubygems". ;)
    >>>
    >>> Most likely, installing RubyGems should be enough.
    >>>
    >>> How did you remove Ruby? Using apt-get? Which options? Or by other
    >>> means?

    >>
    >> sudo aptitude remove ruby

    >
    > Right, I'm a little foggy here (It's been a while since I last touched
    > any from of *NIX).
    >
    > However, it seems that you now have a rather curious state for your Ruby.
    >
    > For one, Ruby is split into several packages (ruby, irb, ruby-dev,
    > libruby, ri; off the top of my head), and a couple of Ruby packages
    > exit, too, most famously RubyGems.
    >
    > However, each distribution (more or less), tweaks their offered packages
    > to conform to the distribution's file system layout.
    >
    > These tweaks are not necessarily identical to what a build from source
    > provides.
    >
    > So, it seems that your Ruby install is in an inconsistent state, where
    > Ruby, and RubyGems don't "know" about each other, since they use
    > different directories.
    >
    > A solution would be to do a "sudo aptitude remove ruby*" to remove
    > anything the distro installed, re-do "sudo make install" in your Ruby
    > source directory, and then install RubyGems and your desired gems (it
    > might be enough to monitor the filesystem, and see which directories
    > "make install" and the RubyGems install create, and to copy your gems
    > into this new directory.
    >
    > Or:
    >
    > You remove compiled-Ruby with the hopefully existing "make uninstall",
    > and then reinstall Ruby from Ubuntu's repositories, and hope that fixes
    > everything (it should).
    >
    > Aside: A tool I found handy when installing from source is Checkinstall:
    > http://checkinstall.izto.org/ allowing to introduce software compiled
    > from source to a distribution's packet management system. :)
    >
    > --
    > Phillip Gawlowski
    >
    >


    Phillip,

    thanks for helping out. A simple reinstall of rubygems and the gems is
    all that was needed to restore the state. (I was trying to avoid this
    being lazy).

    RI is happy again, gems are being found with no issue.

    --
    Kind Regards,
    Rajinder Yadav

    http://DevMentor.org

    Do Good! - Share Freely
    Rajinder Yadav, Dec 27, 2009
    #12
  13. Rajinder Yadav

    Walton Hoops Guest

    On 12/26/2009 9:22 PM, Rajinder Yadav wrote:
    > Phillip Gawlowski wrote:
    >> On 27.12.2009 05:12, Rajinder Yadav wrote:
    >>> I removed my older ruby package from my ubuntu, built ruby from source
    >>> successfully. added the sym link from ruby1.8 -> ruby in /usr/bin/
    >>>
    >>> however from the IRB I'm getting errors it can't find my gems? how do I
    >>> fix this, I assume I need to define some environment variables?

    >>
    >> http://docs.rubygems.org/read/chapter/3
    >>
    >> You need to install RubyGems.
    >>
    >> --
    >> Phillip Gawlowski
    >>
    >>

    >
    > I already had gems installed? are you telling me I got to repeat the
    > entire process to install gem and then all the gem packages?
    >
    > yadav@KubuntuX64:$ gem list
    >
    > *** LOCAL GEMS ***

    I am about 75% sure you have rubygems installed through Ubuntu. I bet
    if you do
    'sudo apt-get remove rubygems' (I think that's right) you'll see what I
    mean. This
    Debian distro of rubygems won't work with the source distro of Ruby (at
    least
    not easily). You'll need to remove the one installed through apt and
    install from source
    as mentioned above.
    Walton Hoops, Dec 27, 2009
    #13
  14. On Sat, Dec 26, 2009 at 11:12 PM, Rajinder Yadav <> wrot=
    e:
    > I removed my older ruby package from my ubuntu, built ruby from source
    > successfully. added the sym link from ruby1.8 -> ruby in /usr/bin/
    >
    > however from the IRB I'm getting errors it can't find my gems? how do I f=

    ix
    > this, I assume I need to define some environment variables?
    >
    >
    > irb(main):003:0> require 'rubygems'
    > LoadError: no such file to load -- rubygems
    > =A0 =A0 =A0 =A0from (irb):3:in `require'
    > =A0 =A0 =A0 =A0from (irb):3
    > =A0 =A0 =A0 =A0from :0
    > irb(main):004:0> require 'grackle'
    > LoadError: no such file to load -- grackle
    > =A0 =A0 =A0 =A0from (irb):4:in `require'
    > =A0 =A0 =A0 =A0from (irb):4
    > =A0 =A0 =A0 =A0from :0


    Despite some of the kind suggestions from others, the particular file
    rubygems.rb should be in

    .../lib/ruby/site_ruby/1.8/

    if Ruby and rubygems are both installed. Note that this is not the
    gem binary, but rather the file which allows your program to load
    gems.

    The ... stands in for an installation path which varies from system to
    system. But should be something like /usr or /usr/local on a Debian
    based system. Actually self installed stuff should be in /user/local
    IIRC so as not to collide with packaged stuff.


    --=20
    Rick DeNatale

    Blog: http://talklikeaduck.denhaven2.com/
    Twitter: http://twitter.com/RickDeNatale
    WWR: http://www.workingwithrails.com/person/9021-rick-denatale
    LinkedIn: http://www.linkedin.com/in/rickdenatale
    Rick DeNatale, Dec 27, 2009
    #14
    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. Midex
    Replies:
    24
    Views:
    915
  2. Alexey Verkhovsky
    Replies:
    0
    Views:
    168
    Alexey Verkhovsky
    Jan 20, 2005
  3. Daniel Berger
    Replies:
    2
    Views:
    111
    Daniel Berger
    Sep 11, 2005
  4. Amjad Syed
    Replies:
    0
    Views:
    122
    Amjad Syed
    Aug 21, 2006
  5. Tim Apple

    Building Ruby From Source?

    Tim Apple, Jul 17, 2009, in forum: Ruby
    Replies:
    6
    Views:
    109
    Simon Krahnke
    Jul 22, 2009
Loading...

Share This Page