Ruby won't compile, cannot install.

13 replies [Last post]
northernarcher
Offline
Joined: 12/24/2014

Following the directions given by a Trisquel user her - https://trisquel.info/en/issues/16192

cd /tmp
wget -c http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p0.tar.gz
tar -xzf ruby-2.0.0-p0.tar.gz
cd ruby-2.0.0-p0
./configure
make

Then it fails to compile with with this error - http://pastebin.com/6KRdjPPH

What do I do?

cmhobbs
Offline
Joined: 06/24/2013

Hello, northernarcher!

You need to install readline. Did ./configure kick out any warnings? I believe it would've caught this. You'll likely also need libssl, build-essential, and a half-dozen other packages. If you're building Ruby in order to build a Rails project, these are the packages you'll need installed before you get started:

build-essential
openssl
libreadline6
libreadline6-dev
curl
git-core
zlib1g
zlib1g-dev
libssl-dev
libyaml-dev
libsqlite3-dev
sqlite3
libxml2-dev
libxslt-dev
autoconf
libc6-dev
ncurses-dev
automake
libtool
bison
nodejs
subversion

For what it's worth, you might want to try using chruby (https://github.com/postmodern/chruby) and ruby-install (https://github.com/postmodern/ruby-install) as it will isolate your ruby versions and handle dependency installation for you. Keeping Ruby up to date is a bit of a chore and these two utilities will help.

There are other build automation tools and version managers but these have worked the best for me. They're lightweight and don't do any of the silly tricks some of the other packages do.

One last thing: Ruby 2.0.0 is severely out of date. The current stable release is 2.3.0 as seen on ruby-lang.org.

Good luck and Happy Hacking!

northernarcher
Offline
Joined: 12/24/2014

Okay, so I tried the ruby-install program and it says it installed successfully but the system can't see it and it does not show up in the package manager.

...
...
...
>>> Successfully installed ruby 2.0.0-p648 into /home/grey/.rubies/ruby-2.0.0-p648
grey@x60:~$ ruby -v
bash: ruby: command not found

jxself
Offline
Joined: 09/13/2010

When you install software in this way you're going behind the package manager's back so it's not going to know about it.

northernarcher
Offline
Joined: 12/24/2014

Alright, well can I live without that bit working. How can I make it so the system can use it though?

northernarcher
Offline
Joined: 12/24/2014

Alright, well can I live without that bit working. How can I make it so the
system can use it though?

jxself
Offline
Joined: 09/13/2010

When you install software in this way you're going behind the package
manager's back so it's not going to know about it.

northernarcher
Offline
Joined: 12/24/2014

Following the directions given by a Trisquel user her -
https://trisquel.info/en/issues/16192

cd /tmp
wget -c http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p0.tar.gz
tar -xzf ruby-2.0.0-p0.tar.gz
cd ruby-2.0.0-p0
./configure
make

Then it fails to compile with with this error - http://pastebin.com/6KRdjPPH

What do I do?

northernarcher
Offline
Joined: 12/24/2014

Okay, so I tried the ruby-install program and it says it installed
successfully but the system can't see it and it does not show up in the
package manager.

...
...
...
>>> Successfully installed ruby 2.0.0-p648 into
/home/grey/.rubies/ruby-2.0.0-p648
grey@x60:~$ ruby -v
bash: ruby: command not found

Magic Banana

I am a member!

I am a translator!

Offline
Joined: 07/24/2010

If you really want Ruby 2.0, why not simply installing the package named "ruby2.0" in Trisquel's repository?

northernarcher
Offline
Joined: 12/24/2014

The reason is that basically it's not really what it says it is. If you install the ruby2.0 package what you actually get is ruby1.9.3 for some reason. A real 2.0 Ruby is not actually in the repo. I don't know if this is a bug or just a mislabeling but I reported it, and the workaround I was given is what I am trying to do now.

https://trisquel.info/en/issues/16192

northernarcher
Offline
Joined: 12/24/2014

The reason is that basically it's not really what it says it is. If you
install the ruby2.0 package what you actually get is ruby1.9.3 for some
reason. A real 2.0 Ruby is not actually in the repo. I don't know if this is
a bug or just a mislabeling but I reported it, and the workaround I was given
is what I am trying to do now.

https://trisquel.info/en/issues/16192

cmhobbs
Offline
Joined: 06/24/2013

Hello, northernarcher!

You need to install readline. Did ./configure kick out any warnings? I
believe it would've caught this. You'll likely also need libssl,
build-essential, and a half-dozen other packages. If you're building Ruby in
order to build a Rails project, these are the packages you'll need installed
before you get started:

build-essential
openssl
libreadline6
libreadline6-dev
curl
git-core
zlib1g
zlib1g-dev
libssl-dev
libyaml-dev
libsqlite3-dev
sqlite3
libxml2-dev
libxslt-dev
autoconf
libc6-dev
ncurses-dev
automake
libtool
bison
nodejs
subversion

For what it's worth, you might want to try using chruby
(https://github.com/postmodern/chruby) and ruby-install
(https://github.com/postmodern/ruby-install) as it will isolate your ruby
versions and handle dependency installation for you. Keeping Ruby up to date
is a bit of a chore and these two utilities will help.

There are other build automation tools and version managers but these have
worked the best for me. They're lightweight and don't do any of the silly
tricks some of the other packages do.

Good luck and Happy Hacking!

Magic Banana

I am a member!

I am a translator!

Offline
Joined: 07/24/2010

If you really want Ruby 2.0, why not simply installing the package named
"ruby2.0" in Trisquel's repository?