Debian, gem(?) , and libraries

Discussion in 'Ruby' started by furufuru@ccsr.u-tokyo.ac.jp, Feb 4, 2006.

  1. -tokyo.ac.jp

    -tokyo.ac.jp Guest

    Hello all,

    I'm using Ruby on Debian GNU/Linux. Ruby itself
    and its standard library were installed as Debian
    packages. Now, I want to add Ruby libraries
    which aren't standard part of Ruby. What do
    people do? I heard of "rubygem". Is it a packaging
    system for Ruby? How does it interact with the
    packaging system of Debian?

    I could just download the sources of those libraries
    and install them under ~/lib/ruby or /usr/local/lib/ruby
    or some such places. But, I guess there are better,
    more organized, and standard ways.

    Regards,
    Ryo
    -tokyo.ac.jp, Feb 4, 2006
    #1
    1. Advertising

  2. > Hello all,
    >
    > I'm using Ruby on Debian GNU/Linux. Ruby itself
    > and its standard library were installed as Debian
    > packages. Now, I want to add Ruby libraries
    > which aren't standard part of Ruby. What do
    > people do? I heard of "rubygem". Is it a packaging
    > system for Ruby? How does it interact with the
    > packaging system of Debian?
    >
    > I could just download the sources of those libraries
    > and install them under ~/lib/ruby or /usr/local/lib/ruby
    > or some such places. But, I guess there are better,
    > more organized, and standard ways.


    RubyGems is a separate packaging system that doesn't cause any
    conflicts with Debian's package system (apt). RubyGems, for me, tends
    to work extremely well and I use it often.

    As far as getting it installed, there's the documentation on the Wiki site:

    http://wiki.rubyonrails.com/rails/pages/RailsOnUbuntuDebianTestingAndUnstab=
    le

    My approach was slightly different. Instead of building from source I
    just to them through apt:

    apt-get install rubygems

    Michael Trier
    Michael Trier, Feb 4, 2006
    #2
    1. Advertising

  3. -tokyo.ac.jp wrote:
    > Hello all,
    >
    > I'm using Ruby on Debian GNU/Linux. Ruby itself
    > and its standard library were installed as Debian
    > packages. Now, I want to add Ruby libraries
    > which aren't standard part of Ruby. What do
    > people do? I heard of "rubygem". Is it a packaging
    > system for Ruby? How does it interact with the
    > packaging system of Debian?


    I'm using gems on Ubuntu (and were using it on debian as well).

    You will have to manually install rubygems from source, but this will be
    easy, after installing ruby-dev (with aptitude).

    On Ubuntu I'm havin the following ruby packages installed via aptitude:
    > i A libreadline-ruby1.8 - Readline interface for Ruby 1.8
    > i A libruby1.8 - Libraries necessary to run Ruby 1.8
    > i ruby - An interpreter of object-oriented scriptin
    > i ruby1.8 - Interpreter of object-oriented scripting l
    > i ruby1.8-dev - Header files for compiling extension modul


    Rubygems:
    > *** LOCAL GEMS ***
    >
    > coverage (0.3)
    > identifies inactive code
    >
    > sources (0.0.1)
    > This package provides download sources for remote gem installation


    This is an example for a library that is not available as a Debian package.

    Debian packages on the other hand need to pass some procedure to be
    included in the stable or testing branch, so it could take some time for
    new libraries to show up.

    Rubygems and debian packages are independent (they don't know about each
    other), be careful if you both install a library via rubygems and debian
    package management (should be: don't do this).

    > I could just download the sources of those libraries
    > and install them under ~/lib/ruby or /usr/local/lib/ruby
    > or some such places. But, I guess there are better,
    > more organized, and standard ways.


    There is http://raa.ruby-lang.org/ as well, but I haven't used it.

    Using rubygems is working fine for me.
    Stefan Mahlitz, Feb 4, 2006
    #3
  4. Michael Trier wrote:
    > My approach was slightly different. Instead of building from source I
    > just to them through apt:
    >
    > apt-get install rubygems


    What is in your sources.list - the package doesn't show up.
    Stefan Mahlitz, Feb 4, 2006
    #4
  5. Stefan Mahlitz schrieb:
    > Michael Trier wrote:
    >>My approach was slightly different. Instead of building from source I
    >>just to them through apt:
    >>
    >>apt-get install rubygems

    >
    >
    > What is in your sources.list - the package doesn't show up.


    Hello,
    I have installed it from an unofficial repository here:

    deb http://www.sgtpepper.net/hyspro/deb unstable/ #rubygems

    Works fine so far.
    Manuel
    Manuel Kasten, Feb 4, 2006
    #5
  6. On Sat, Feb 04, 2006 at 01:58:18PM +0900, -tokyo.ac.jp wrote:
    } Hello all,
    }
    } I'm using Ruby on Debian GNU/Linux. Ruby itself
    } and its standard library were installed as Debian
    } packages. Now, I want to add Ruby libraries
    } which aren't standard part of Ruby. What do
    } people do? I heard of "rubygem". Is it a packaging
    } system for Ruby? How does it interact with the
    } packaging system of Debian?
    }
    } I could just download the sources of those libraries
    } and install them under ~/lib/ruby or /usr/local/lib/ruby
    } or some such places. But, I guess there are better,
    } more organized, and standard ways.

    I spent a fair amount of time making RubyGems install properly into
    /usr/local/bin on Debian and keep itself there. By default, unfortunately,
    it really wants to install gems in /usr/lib regardless of where it has been
    installed. To work around this shortcoming, I've developed an install
    script for RubyGems. It isn't Debian-specific, but it certainly works well
    on Debian. The script follows. PAY ATTENTION TO THE MESSAGE AT THE END!

    } Regards,
    } Ryo
    --Greg

    #!/bin/sh

    if test $# -ne 1
    then
    echo "Usage: $0 <destination dir>" >&2
    exit 1
    elif test ! -r setup.rb
    then
    echo "Please run from the toplevel RubyGems source directory" >&2
    exit 2
    fi

    GEM_HOME="$1/lib/site_ruby/gems"
    export GEM_HOME

    if test -d "$GEM_HOME"
    then
    cat <<-EOF >&2

    The GEM_HOME directory already exists. Overwriting an existing
    install will not work well. If you intend to reinstall, please
    first remove $GEM_HOME

    EOF
    exit 3
    elif ! mkdir -p "$GEM_HOME"
    then
    cat <<-EOF >&2

    You do not have permission to install in the directory selected.
    Perhaps you meant to install as root?

    EOF
    exit 4
    fi

    while test ! -e "$GEM_HOME/bin"
    do

    echo -n "Where should executables be installed [$GEM_HOME/bin]? " >&2
    read dest

    if test "$dest" = "" -a "$dest" = "$GEM_HOME/bin"
    then
    dest="$GEM_HOME/bin"
    mkdir "$dest"
    elif test -d "$dest"
    then
    ln -s "$dest" "$GEM_HOME/bin"
    else
    echo "You must choose an existing directory." >&2
    fi
    done

    ruby setup.rb config --prefix="$1" --siteruby=\$prefix/lib/site_ruby && \
    ruby setup.rb install

    cat <<EOF >&2

    ################################################################################

    Be sure to set the GEM_HOME environment variable in your shell's
    init/config file to '$GEM_HOME'

    For Bourne shell derivatives, add the following lines to your
    ~/.profile or the system-wide /etc/profile:

    GEM_HOME="$GEM_HOME"
    export GEM_HOME

    For C shell derivatives, add the following line to your ~/.cshrc
    (or ~/.tcshrc) or the system-wide /etc/csh.cshrc:

    setenv GEM_HOME "$GEM_HOME"

    ################################################################################

    EOF
    Gregory Seidman, Feb 4, 2006
    #6
  7. -tokyo.ac.jp

    -tokyo.ac.jp Guest

    Thank you all who responded.

    I suceeded in installing rubygems in /usr/local/bin
    by a method along the lines Gregory suggested.
    But after that, I switched to the unofficial Debian package
    Manuel mentioned.

    Now, my original purpose at hand was to install
    a command-line argument parser. By searching
    the Internet, I had learned there are getopt, getoptlong,
    optparse (parseopt??), and ropt. (Sorry if I misspelt some
    of them). Reading some documents, I decided I like the
    simplicity of ropt. But then, "gem search opt --remote"
    listed getopt, getopt-declare, and OptionParser.
    Not ropt. Argh.

    1) Does the gem system work for those libraries which
    aren't shown in the listing? In other words, if the gem
    command doesn't show a library, would you need to
    install it separately from the gem framework?

    2) How do you install ruby libraries which are not on
    the gem framework?

    3) Which command line argument parser is "standard"?
    (Please user your own definition of "standard" :)

    Thank you,
    Ryo
    -tokyo.ac.jp, Feb 5, 2006
    #7
  8. -tokyo.ac.jp

    Meiao Guest

    I pretty much don't like Debian's packages for ruby.
    I preferred to install everything by source.
    Meiao, Feb 6, 2006
    #8
  9. -tokyo.ac.jp

    -tokyo.ac.jp Guest

    [. . .]
    > 2) How do you install ruby libraries which are not on
    > the gem framework?


    I went ahead and installed ropt. It came with
    an installation script:

    $ ruby install.rb config
    $ ruby install.rb setup
    # ruby install.rb install

    Then it installed (copied) the library
    to /usr/local/lib/site_ruby/1.8/ (I hope I rememer
    correctly. The machine is at home). This is the
    same directory as gem manages, I think. Is this what
    people normally do?

    I think this is OK, until the files installed
    outside the gem framework conflict with those in
    the gem archive.

    Ryo
    -tokyo.ac.jp, Feb 6, 2006
    #9
  10. That's where I got it as well

    On 2/4/06, Manuel Kasten <> wrote:
    > Stefan Mahlitz schrieb:
    > Hello,
    > I have installed it from an unofficial repository here:
    >
    > deb http://www.sgtpepper.net/hyspro/deb unstable/ #rubygems
    >
    > Works fine so far.
    > Manuel
    >
    >
    Michael Trier, Feb 7, 2006
    #10
    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. Luke Kenneth Casson Leighton
    Replies:
    0
    Views:
    467
    Luke Kenneth Casson Leighton
    Dec 31, 2008
  2. Zach Dennis

    debian ruby libraries

    Zach Dennis, Jun 28, 2004, in forum: Ruby
    Replies:
    1
    Views:
    112
    Eric Schwartz
    Jun 28, 2004
  3. Replies:
    1
    Views:
    104
  4. subimage
    Replies:
    9
    Views:
    239
    Thomas Sondergaard
    Jul 29, 2006
  5. Austin 7873
    Replies:
    5
    Views:
    184
    Eric Hodel
    Jan 27, 2007
Loading...

Share This Page