Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Debian, gem(?) , and libraries

Reply
Thread Tools

Debian, gem(?) , and libraries

 
 
furufuru@ccsr.u-tokyo.ac.jp
Guest
Posts: n/a
 
      02-04-2006
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

 
Reply With Quote
 
 
 
 
Michael Trier
Guest
Posts: n/a
 
      02-04-2006
> 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/pa...tingAndUnstab=
le

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

apt-get install rubygems

Michael Trier


 
Reply With Quote
 
 
 
 
Stefan Mahlitz
Guest
Posts: n/a
 
      02-04-2006
http://www.velocityreviews.com/forums/(E-Mail Removed)-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.


 
Reply With Quote
 
Stefan Mahlitz
Guest
Posts: n/a
 
      02-04-2006
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.


 
Reply With Quote
 
Manuel Kasten
Guest
Posts: n/a
 
      02-04-2006
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
 
Reply With Quote
 
Gregory Seidman
Guest
Posts: n/a
 
      02-04-2006
On Sat, Feb 04, 2006 at 01:58:18PM +0900, (E-Mail Removed)-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



 
Reply With Quote
 
furufuru@ccsr.u-tokyo.ac.jp
Guest
Posts: n/a
 
      02-05-2006
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

 
Reply With Quote
 
Meiao
Guest
Posts: n/a
 
      02-06-2006
I pretty much don't like Debian's packages for ruby.
I preferred to install everything by source.

 
Reply With Quote
 
furufuru@ccsr.u-tokyo.ac.jp
Guest
Posts: n/a
 
      02-06-2006
[. . .]
> 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

 
Reply With Quote
 
Michael Trier
Guest
Posts: n/a
 
      02-07-2006
That's where I got it as well

On 2/4/06, Manuel Kasten <(E-Mail Removed)> 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
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
standard libraries don't behave like standard 'libraries' Sriram Srinivasan Python 13 11-12-2009 06:05 PM
How come Python software, tools and libraries is so good? A hug toGvr and the Python community! cnb Python 0 08-27-2008 11:50 PM
Using mandatory libraries (custom class loading vs. expanding libraries) Karsten Wutzke Java 21 06-29-2007 09:25 PM
autoscan automake and similar and deprecated standard libraries classes Shalafi C++ 2 02-13-2005 11:17 PM
Re: ModelSim 5.7 and xilinx libraries David Bishop VHDL 1 06-28-2003 04:53 PM



Advertisments