Ruby and Debian

I don't wish to open a can of worms here. I'm not even a Debian
user, I'm just trying to help a friend.

Please refrain if you can from digressing into discussions of politics,
licenses, package management, rubygems replacements, or "my distro can
beat up your distro."

I met with a friend at breakfast this morning. Coffee shop with killer
pastries and wi-fi, ahhhh.

He's a Debian guy. Our purpose in meeting was to install Ruby and rubygems
and one other library and then play with it a little. (He doesn't know
Ruby yet.)

He tried an apt-get before I got there. After fiddling a bit, I suggested
installing from source -- rubygems was complaining about zlib.

We installed from source, got no zlib, thus rubygems crashed. Tried an
apt-get of zlib-ruby, but no joy. Version conflict or something.

Gave up, moved to a different server, did everything the "right" way.
Wasted over an hour. Never got ruby/zlib/rubygems all installed properly
on either box.

Moved to a Red Hat server where it all "just worked."

What's the magic to get this going on Debian?

Thanks,
Hal

stable:

aptitude install zlib1g-dev

then try to configure and compile ruby again.

Hal Fulton wrote:

What's the magic to get this going on Debian?

Last time I tried this, I discovered that Ruby is split into a whole lot
of packages. I'm sure there's a really good reason the packagers split
Ruby into so many packages, but I've found that installing from source
is quicker and easier if you want everything. Maybe the packages are
useful for people who want a minimal install.

Sorry, I realize this isn't the most helpful answer.

Jen

···

--
Posted via http://www.ruby-forum.com/\.

Hal-

  After quite a few times experimenting to get a nice setup for ruby
and rails on debian, I wrote a detailed tutorial[1]. The tutorial
covers some stuff you probably don't need or already have installed
but it does install a fully working ruby and gems plus other goodies
like Imagemagick and Rmagick plus the mysql-ruby bindings. So you can
probably find what you need in it.

[1] Ruby on Rails Blog / What is Ruby on Rails for?

Cheers-

-Ezra

···

On 12/16/05, Hal Fulton <hal9000@hypermetrics.com> wrote:

What's the magic to get this going on Debian?

Thanks,
Hal

Assuming you're using Ruby 1.8 you need to

apt-get install libruby1.8

it replaces libzlib-ruby1.8

FWIW I've never used libzlib, but have (and do) use ruby on debian.

I usually use debian's ruby package, and libs such as fcgi/mysql
I haven't seen a rubygem package for debian since 8.4, which can still
be used if you do the following
# gem install rubygems-update
AND
# update_rubygems

Although it's just as easy to install rubygems from source, and lately
I've just been doing that.

For Rails, I ALWAYS use rubygems to install it. I've never had luck
with the debian packages.

Obviously it's kind of a try and see type of thing, there really is no
"right way".
As silly as this sounds, I typically install gems via gem (rubygems)
and anything that starts with lib via apt. :wink:

The following commands help alot while searching for ruby packages via
apt, just replace "libruby1.8" with whatever you're looking for.
apt-cache search libruby1.8 | grep ruby
apt-cache search ruby | grep libruby1.8
apt-cache show libruby1.8

HTH

···

On 12/16/05, Hal Fulton <hal9000@hypermetrics.com> wrote:

What's the magic to get this going on Debian?

--
Chris Martin
Web Developer
Open Source & Web Standards Advocate

Now I'm having trouble compliling ruby 1.8.3 on Debian stable with tk
support so I can play rrobots. Anyone help here?

Hi:

···

On Sat, Dec 17, 2005 at 03:51:29PM +0900, Hal Fulton wrote:

I don't wish to open a can of worms here. I'm not even a Debian
user, I'm just trying to help a friend.

Please refrain if you can from digressing into discussions of politics,
licenses, package management, rubygems replacements, or "my distro can
beat up your distro."

I met with a friend at breakfast this morning. Coffee shop with killer
pastries and wi-fi, ahhhh.

He's a Debian guy. Our purpose in meeting was to install Ruby and rubygems
and one other library and then play with it a little. (He doesn't know
Ruby yet.)

He tried an apt-get before I got there. After fiddling a bit, I suggested
installing from source -- rubygems was complaining about zlib.
[...]

    Is he using Debian stable? Is it a server? That is supposed to have been
fixed months ago (in sid and testing).

    If he's indeed using stable, you'll have to install a couple of packages
to have a complete Ruby installation. There was a guide somewhere in the Rails
Wiki (it doesn't work for me right now, network problems?).

    HTH,

--
Esteban Manchado Velázquez <zoso@foton.es> - http://www.foton.es
EuropeSwPatentFree - http://EuropeSwPatentFree.hispalinux.es

I don't wish to open a can of worms here. I'm not even a Debian
user, I'm just trying to help a friend.

Please refrain if you can from digressing into discussions of politics,
licenses, package management, rubygems replacements, or "my distro can
beat up your distro."

I met with a friend at breakfast this morning. Coffee shop with killer
pastries and wi-fi, ahhhh.

He's a Debian guy. Our purpose in meeting was to install Ruby and rubygems
and one other library and then play with it a little. (He doesn't know
Ruby yet.)

He tried an apt-get before I got there. After fiddling a bit, I suggested
installing from source -- rubygems was complaining about zlib.

We installed from source, got no zlib, thus rubygems crashed. Tried an
apt-get of zlib-ruby, but no joy. Version conflict or something.

If you're installing from source, you need zlib1g-dev (in Debianese,
"-dev" suffix == header files).

Gave up, moved to a different server, did everything the "right" way.
Wasted over an hour. Never got ruby/zlib/rubygems all installed properly
on either box.

Depending on the version of Debian (I'm using Sid, so the way things are
for me are how they'll be for you eventually), it _should_ be this
simple:

  # install ruby and ruby development packages
  sudo apt-get install ruby1.8{,-dev} libruby1.8

  # install gems from source
  gem_url='http://rubyforge.org/frs/download.php/5207/rubygems-0.8.11.tgz&#39;
  wget $gem_url && tar zxf rubygems-0.8.11.tar.gz && \
    cd rubygems-0.8.11 && sudo ruby setup.rb
    
If zlib wasn't listed as a dependency for libruby1.8 on the system in
question, it is now (in the more recent versions):

  pabs@halcyon:~> ach libruby1.8 | grep Dep.*zlib
  Depends: libc6 (>= 2.3.5-1), libncurses5 (>= 5.4-5), zlib1g (>=
  1:1.2.1)

···

* Hal Fulton (hal9000@hypermetrics.com) wrote:

Moved to a Red Hat server where it all "just worked."

What's the magic to get this going on Debian?

--
Paul Duncan <pabs@pablotron.org> pabs in #ruby-lang (OPN IRC)
http://www.pablotron.org/ OpenPGP Key ID: 0x82C29562

Hal Fulton wrote:

He's a Debian guy. Our purpose in meeting was to install Ruby and rubygems
and one other library and then play with it a little. (He doesn't know
Ruby yet.)

He tried an apt-get before I got there. After fiddling a bit, I suggested
installing from source -- rubygems was complaining about zlib.

Probably not such a good idea, because then you lose dependency handling.

We installed from source, got no zlib, thus rubygems crashed.

Sounds like a bug in Ruby. The ./configure ought to test for the presence of zlib. I'd report the bug.

Gave up, moved to a different server, did everything the "right" way.
Wasted over an hour. Never got ruby/zlib/rubygems all installed properly
on either box.

Well, I've got a vanilla debian-stable server hanging around that I've never done any Ruby work on, so I've just tried the obvious 'right' way of doing everything, and it all worked first time:

# apt-get install ruby
Reading package lists... Done
Building dependency tree... Done
The following extra packages will be installed:
   libruby1.8 ruby1.8
Suggested packages:
   ruby1.8-examples rdoc1.8 ri1.8
The following NEW packages will be installed:
   libruby1.8 ruby ruby1.8
0 upgraded, 3 newly installed, 0 to remove and 4 not upgraded.
Need to get 1500kB/1519kB of archives.
After unpacking 5837kB of additional disk space will be used.
Do you want to continue [Y/n]? Y
[Stuff scrolls past]
# wget http://rubyforge.org/frs/download.php/5207/rubygems-0.8.11.tgz
# tar -xzf rubygems-0.8.11.tgz
# cd rubygems-0.8.11
# ruby setup.rb
[Stuff scrolls past]
# gem install vim-ruby
[Stuff scrolls past]
Successfully installed vim-ruby-2005.10.07

···

#

I note also that ruby correctly has zlib as a dependency in Debian stable. So apt-get install ruby should have installed zlib even if it was missing.

So I'm guessing your friend's debian box is b0rked in some major way.

mathew
--
       <URL:http://www.pobox.com/~meta/&gt;
My parents went to the lost kingdom of Hyrule
     and all I got was this lousy triforce.

Hal Fulton wrote:
> What's the magic to get this going on Debian?

Last time I tried this, I discovered that Ruby is split into a whole lot
of packages. I'm sure there's a really good reason the packagers split
Ruby into so many packages, but I've found that installing from source
is quicker and easier if you want everything. Maybe the packages are
useful for people who want a minimal install.

They fixed this brain-dead policy recently.

I use Debian for everything personally, but adding "this library is in
the standard library, except in Debian" to my documentation was getting
a bit old.

···

* jennyw jennyw (jennyw@dangerousideas.com) wrote:

Sorry, I realize this isn't the most helpful answer.

Jen

--
Posted via http://www.ruby-forum.com/\.

--
Paul Duncan <pabs@pablotron.org> pabs in #ruby-lang (OPN IRC)
http://www.pablotron.org/ OpenPGP Key ID: 0x82C29562

>
> What's the magic to get this going on Debian?

[snipped]

The following commands help alot while searching for ruby packages via
apt, just replace "libruby1.8" with whatever you're looking for.
apt-cache search libruby1.8 | grep ruby
apt-cache search ruby | grep libruby1.8
apt-cache show libruby1.8

  # save your fingers and keep your hair
  alias acs='apt-cache search --names-only'

Produces:

  pabs@halcyon:~> acs libruby
  libruby - Libraries necessary to run Ruby 1.8.x
  libruby1.6 - Libraries necessary to run Ruby 1.6.x
  libruby1.6-dbg - Debugging libraries for Ruby 1.6.x
  libruby1.8 - Libraries necessary to run Ruby 1.8
  libruby1.8-dbg - Debugging libraries for Ruby 1.8
  libruby1.9 - Libraries necessary to run Ruby 1.9
  libruby1.9-dbg - Debugging libraries for Ruby 1.9

···

* Chris Martin (chriscodes@gmail.com) wrote:

On 12/16/05, Hal Fulton <hal9000@hypermetrics.com> wrote:

--
Paul Duncan <pabs@pablotron.org> pabs in #ruby-lang (OPN IRC)
http://www.pablotron.org/ OpenPGP Key ID: 0x82C29562

Hello.

Chris Martin:

I haven't seen a rubygem package for debian since 8.4,

Hyspro seems to have 0.8.11 - see the end of
http://pkg-ruby-extras.alioth.debian.org/rubygems.html

which can still be used if you do the following
# gem install rubygems-update
AND
# update_rubygems

What is the purpose of this? Does this keep the rubygems updated
'the Debian way', i.e. dpkg knows about any added/removed files?

Although it's just as easy to install rubygems
from source, and lately I've just been doing that.

Right, but if you don't put it in /opt, you're polluting the
dpkg's file hierarchy. You could at least `checkinstall -D`.

For Rails, I ALWAYS use rubygems to install it.
I've never had luck with the debian packages.

Hm, the rails Debian package always worked for me as a charm.

Obviously it's kind of a try and see type
of thing, there really is no "right way".
As silly as this sounds, I typically install gems via
gem (rubygems) and anything that starts with lib via apt. :wink:

I try to install anything I can via apt, so as to minimise the
filesystem pollution and to have other Debian packages that might
depend on a given thing have it fulfilled without duplications.

I was wondering whether anyone tried
`checkinstall -D gem install ...`
- does this work/makes sense?

Cheers,
-- Shot

···

--
        SCO is the thief who puts a gun to his own head and says 'give
        me your money or I'll shoot.' -- Bruce Perens, /.
====================== home.pl: Nr 1 w Polsce. Domeny, Hosting, Serwery WWW, Strony, eSklep, Office 365 === home.pl: Nr 1 w Polsce. Domeny, Hosting, Serwery WWW, Strony, eSklep, Office 365 ===

Chris Martin wrote:

What's the magic to get this going on Debian?

Assuming you're using Ruby 1.8 you need to

apt-get install libruby1.8

But ruby already lists libruby1.8 as a dependency, so that shouldn't be the problem. It should already have been installed when ruby was installed.

For Rails, I ALWAYS use rubygems to install it. I've never had luck
with the debian packages.

Yes, well, let's not reopen the RubyGems vs APT discussion again... That's one area where the Debian folk deserve criticism, but they don't seem to have any interest in cooperating to fix the problem.

So yeah, the best thing is to install RubyGems from source and use it for all Ruby libraries. Or as you say:

As silly as this sounds, I typically install gems via gem (rubygems)
and anything that starts with lib via apt. :wink:

mathew

···

On 12/16/05, Hal Fulton <hal9000@hypermetrics.com> wrote:

--
      <URL:http://www.pobox.com/~meta/&gt;
My parents went to the lost kingdom of Hyrule
     and all I got was this lousy triforce.

Esteban Manchado Velázquez wrote:

    If he's indeed using stable, you'll have to install a couple of packages
to have a complete Ruby installation.

Specifically:

ruby
ri1.8
rdoc1.8

The latter two are suggested by APT when you install the first.

mathew

···

--
      <URL:http://www.pobox.com/~meta/&gt;
My parents went to the lost kingdom of Hyrule
     and all I got was this lousy triforce.

Is there an easy way for Debian users to create .debs for stuff
otherwise installed via gems or with setup.rb? I regularly create
.debs for "./configure; make; make install" by using checkinstall, but
am unaware of the ruby equivalent, if any. I'd heard that it's out
there, but haven't seen it in my googling.

Thanks,

···

On 12/21/05, mathew <meta@pobox.com> wrote:

Chris Martin wrote:
>On 12/16/05, Hal Fulton <hal9000@hypermetrics.com> wrote:
>>What's the magic to get this going on Debian?
>
> Assuming you're using Ruby 1.8 you need to
>
> apt-get install libruby1.8

But ruby already lists libruby1.8 as a dependency, so that shouldn't be
the problem. It should already have been installed when ruby was installed.

> For Rails, I ALWAYS use rubygems to install it. I've never had luck
> with the debian packages.

Yes, well, let's not reopen the RubyGems vs APT discussion again...
That's one area where the Debian folk deserve criticism, but they don't
seem to have any interest in cooperating to fix the problem.

So yeah, the best thing is to install RubyGems from source and use it
for all Ruby libraries. Or as you say:

> As silly as this sounds, I typically install gems via gem (rubygems)
> and anything that starts with lib via apt. :wink:

mathew
--
      <URL:http://www.pobox.com/~meta/&gt;
My parents went to the lost kingdom of Hyrule
     and all I got was this lousy triforce.

--

  -- AL --

Hello.

mathew:

Esteban Manchado Velázquez wrote:

If he's indeed using stable, you'll have to install
a couple of packages to have a complete Ruby installation.

Specifically:

ruby
ri1.8
rdoc1.8

Or, better yet, ri and rdoc (dummy packages depending on the latest ri
and RDoc versions, just like the ruby one depends on the latest Ruby)
- this way you'll get automagically upgraded to 2.0 if/when the next
Debian stable ships it.

Cheers,
-- Shot

···

--
         Life is like sendmail: you're not sure you know how to handle
         it, but you know it'll end in tears. -- Malcolm Ray, asr
====================== home.pl: Nr 1 w Polsce. Domeny, Hosting, Serwery WWW, Strony, eSklep, Office 365 === home.pl: Nr 1 w Polsce. Domeny, Hosting, Serwery WWW, Strony, eSklep, Office 365 ===

It's called equivs, and I've never used it but I know you can do it.
Try that for a google keyword.

Hello.

mathew:

Yes, well, let's not reopen the RubyGems vs APT discussion again...
That's one area where the Debian folk deserve criticism, but they
don't seem to have any interest in cooperating to fix the problem.

Don't you think that following 'let's not reopen' with 'Debian folk
deserve criticism' and 'don't seem to have any interest in cooperating'
seems a bit contradictory?

Al Gordon:

Is there an easy way for Debian users to create .debs for stuff
otherwise installed via gems or with setup.rb? I regularly create
.debs for "./configure; make; make install" by using checkinstall,
but am unaware of the ruby equivalent, if any.

Don't `checkinstall gem install ...`
and `checkinstall ruby setup.rb` work?

(Not tried these, just wondering.)

Cheers,
-- Shot (who believes that Debian folks are right in trying to follow FHS)

···

--
        You're basically killing each other to see who's got the better
        imaginary friend. -- Yasir Arafat on religious wars
====================== home.pl: Nr 1 w Polsce. Domeny, Hosting, Serwery WWW, Strony, eSklep, Office 365 === home.pl: Nr 1 w Polsce. Domeny, Hosting, Serwery WWW, Strony, eSklep, Office 365 ===

The point of Stable is that it doesn't change, so that you'll never have
to worry about something that works suddenly breaking when you're doing
security updates or adding software. Thus, one tends to not see new
packages appear in Stable unless absolutely necessary for security
reasons.

···

On Sat, Dec 24, 2005 at 07:44:41AM +0900, Shot - Piotr Szotkowski wrote:

Hello.

mathew:

> ruby
> ri1.8
> rdoc1.8

Or, better yet, ri and rdoc (dummy packages depending on the latest ri
and RDoc versions, just like the ruby one depends on the latest Ruby)
- this way you'll get automagically upgraded to 2.0 if/when the next
Debian stable ships it.

--
Chad Perrin [ CCD CopyWrite | http://ccd.apotheon.org ]

unix virus: If you're using a unixlike OS, please forward
this to 20 others and erase your system partition.

equivs is for creating (mostly) empty .deb packages, for testing purposes
or to work-around dependency problems.

    There isn't (yet) a way to create a .deb package from a Ruby Gem or a
setup.rb-ridden Ruby tarball, but we're working on it (specially the second).

    Regards,

···

On Fri, Dec 23, 2005 at 10:32:50PM +0900, Hans Fugal wrote:

It's called equivs, and I've never used it but I know you can do it.
Try that for a google keyword.

--
Esteban Manchado Velázquez <zoso@foton.es> - http://www.foton.es
EuropeSwPatentFree - http://EuropeSwPatentFree.hispalinux.es