Fixing problems with Rails, RVM, openssl, and readline on Ubuntu

When you start working with RVM on Ubuntu, probably you’ll face some configuration problems while trying to execute script/console (Rails 2.x), e.g.:

no such file to load -- readline (LoadError)

or even

no such file to load -- openssl (LoadError)

The oficial RVM website offers one solution, but this may not apply for all situations.

To fix that problem, you’ll need to do the following:

1) Install openssl and readline libraries via apt:

$ sudo apt-get install libreadline6 libreadline6-dev openssl libssl0.9.8 libssl-dev libopenssl-ruby

2) Reinstal your ruby version using RVM, specifying readline and openssl directories:

$ cd <path to your Rails project>
$ rvm remove 1.8.7
$ rvm install 1.8.7 --with-readline-dir=/usr/include/readline/ --with-openssl-dir=/usr/include/openssl/

This example works with Ruby version 1.8.7 on Ubuntu 10. Make the proper changes to meet your environment. I’ve tested this solution with Rails 2.3.10 – I believe it will work with other versions/evironments as well.

Worked with you in another configuration? Just drop a line in the comments bellow and let me know!

(Português) Livro: Vá aonde seu coração mandar

Sorry, this entry is only available in Português.

(Português) Livro: Miguel Strogoff

(Português) Livro: Sob o olhar de Deus – memórias de um cirurgião

Sorry, this entry is only available in Português.

(Português) Livro: Eugenia Grandet

Sorry, this entry is only available in Português.

(Português) Filme: Le Concert

(Português) Tecnologia a serviço do circo eleitoral

Sorry, this entry is only available in Português.

(Português) Livro: A 25ª hora

(Português) Livro: Um dia na vida de Ivan Deníssovitch

Sorry, this entry is only available in Português.

(Português) Livro: Ratos e Homens

Leia o restante do artigo »