Compiling ruby on linux

I need to use ruby 1.8.5 whereas the linux I am using – ubuntu edgy –
gives 1.8.4.

Tried to download sources and compile.

Seemed to go fine but when I tried to setup gem it barfed saying the
zlib library is not available

Also the up-arrow key is not working in irb

So any pointers to compiling ruby on ubuntu-edgy?

On 3/1/07, Rustom M. [email protected] wrote:

So any pointers to compiling ruby on ubuntu-edgy?
I’ve found it to be a bit of a puzzle session.

Generally ruby compiles fine, but various extensions require the
system to have a variety of external files. It’s usually a bit of
trial and error to figure out which files are needed and then which
debian/ubuntu packages provide those files.

You’ll find that the source distribution has a directory called ext
which in turn has a subdirectory for each extension. So look in
ext/zlib in your source directory for a file called mkmf.log this
should contain a log of what tests were done when building the zlib
extension. You’re likely to find that one or more files (probably .h
files, or perhaps library files) were missing. Then try to figure out
which debian packages you need. Google is the obvious tool for this.
There’s also a nice tool called apt-file (in a package of the same
name) which can be used to search for files in packages on the
repositories.

Your problem with up-arrow in irb is probably due to a similar problem
building the readline extension.

HTH.

Rick DeNatale

My blog on Ruby
http://talklikeaduck.denhaven2.com/

On Thursday 01 March 2007 01:18:03 pm Rustom M. wrote:

So any pointers to compiling ruby on ubuntu-edgy?
Have you tried installing zlib?

RPM resource zlib
http://www.zlib.net/

Btw, I did a google for zlib ubunty edgy and came across this…

Not sure if it applies, but it’s worth a shot. :slight_smile:


Samantha

http://www.babygeek.org/

“Beware when the great God lets loose a thinker on this planet. Then
all things are at risk.”
 --Ralph Waldo Emerson

On Fri, 02 Mar 2007 10:12:19 +0900, Samantha wrote:

So any pointers to compiling ruby on ubuntu-edgy?

Have you tried installing zlib?

RPM resource zlib
+…

If you’re suggesting rpmfind.net, then you don’t know the first thing
about Ubuntu. Ubuntu is a Debian derivative, so all you need to do is
apt-
get install whatever you want.

On Fri, 02 Mar 2007 03:18:03 +0900, Rustom M. wrote:

So any pointers to compiling ruby on ubuntu-edgy?
First off, you can install ruby on Ubuntu by running “apt-get install
ruby”. If you can’t do that because you’re trying to compile some more
recent version of ruby, then you can pull in Ruby’s build dependancies
by
running “apt-get build-dep ruby1.8” which should install everything you
need to compile Ruby. (Also be sure to install build-essential if you
haven’t already done so – I think you have otherwise you wouldn’t have
made it this far.)

–Ken

On Fri, 2 Mar 2007, Samantha wrote:

On Thursday 01 March 2007 01:18:03 pm Rustom M. wrote:

So any pointers to compiling ruby on ubuntu-edgy?
I don’t know about Ubuntu, but Debian has 1.8.5 in unstable. In Debian
the
procedure to build an “unstable” version on stable would be:

vim /etc/apt/sources.list

# add a source line for unstable sources

apt-get install build-dep ruby1.8

apt-get source ruby1.8

cd ruby1.8*

debuild

*t

Thanks all for all the posts. I learnt something from each of these.
However I still cannot compile ruby on ubuntu.
Strangely it compiles easily on debian ?!
I posted a question on the ubuntu compiling forum thinking that that is
more suitable for compiling ruby on ubuntu than the ruby-forum. However
since there is no reply I am cross-posting (the link) here

I should also mention that I tried Thomas Popisek’s debuild approach
which also didn’t work.

On 3/1/07, Ken B. [email protected] wrote:

First off, you can install ruby on Ubuntu by running “apt-get install
ruby”.

Personally, I’ve given up on using the debian packaged ruby and the
ubuntu versions thereof for a variety of reasons besides being back
level.

The biggie is that debian doesn’t really support gems properly,
there’s a raging disagreement between the way gem structures its files
and the debian philosophy.

I was also quite surprised when I discovered that the debian package
for rails actually replaces the original rails ruby script with a bash
script.


Rick DeNatale

My blog on Ruby
http://talklikeaduck.denhaven2.com/

Ken B. wrote:

If you’re suggesting rpmfind.net, then you don’t know the first thing
about Ubuntu. Ubuntu is a Debian derivative, so all you need to do is apt-
get install whatever you want.

Unless it is not in the standard repos, installed by default in the
sources.lst.


Phillip “CynicalRyan” Gawlowski

Rule of Open-Source Programming #13:

Your first release can always be improved upon.

On Behalf Of Rustom M.:

Thanks all for all the posts. I learnt something from each of these.

However I still cannot compile ruby on ubuntu.

Strangely it compiles easily on debian ?!

I posted a question on the ubuntu compiling forum thinking

that that is

more suitable for compiling ruby on ubuntu than the

ruby-forum. However

since there is no reply I am cross-posting (the link) here

problems compiling ruby

try slowly. do not go to next step if you get an error.
on my ubuntu dapper box, i have the ff below. you may need to do some
changes to adjust on the current distro/package/gems versions. this is
an old box. (note, the build-essential part is very important for
ubuntu/debian boxes)

root@pc4all:~# cat /etc/issue
Ubuntu 6.06.1 LTS \n \l
root@pc4all:~# ll | grep -i install
-rwxr-xr-x 1 root root 71 May 4 2006 install-build-essential
-rwxr-xr-x 1 root root 264 Jul 31 2006 install-gems
-rwxr-xr-x 1 root root 133 May 4 2006 install-posgres
-rwxr-xr-x 1 root root 170 Jun 11 2006 install-rails
-rwxr-xr-x 1 root root 380 Dec 28 11:19 install-ruby
-rwxr-xr-x 1 root root 467 Dec 28 10:42 install-rubygems
-rwxr-xr-x 1 root root 359 Dec 28 10:41 install-rubyzlib
root@pc4all:~# cat install-build-essential
apt-get install build-essential zlib1g-dev libreadline5-dev libssl-dev
root@pc4all:~# cat install-ruby
cd /usr/local/src
echo getting ruby from the net…
wget http://ftp.ruby-lang.org/pub/ruby/stable-snapshot.tar.gz
echo installing ruby…
tar zxvf stable-snapshot.tar.gz
cd ruby
./configure
make
echo testing ruby install…
make test
make install
make install-doc
cd …
echo finished install ruby. thank you.
root@pc4all:~# cat install-rubyzlib
cd /usr/local/src
echo getting zlib from the net…
wget -c http://www.blue.sky.or.jp/atelier/ruby/ruby-zlib-0.6.0.tar.gz
echo installing zlib…
tar zxvf ruby-zlib-0.6.0.tar.gz
cd ruby-zlib-0.6.0
ruby extconf.rb
make
make test
make install
cd …
echo finished install ruby-zlib. thank you.
root@pc4all:~# cat install-rubygems
cd /usr/local/src
echo getting rubygems from the net…
wget http://rubyforge.org/frs/download.php/11289/rubygems-0.9.0.tgz
echo installing rubygems…
tar zxvf rubygems-0.9.0.tgz
cd rubygems-0.9.0
ruby setup.rb
gem install rubygems-update
gem update --system

install other useful gems here

echo finished install rubygem. thank you.
root@pc4all:~#

hth.
kind regards -botp