Problems Faced while Setting up Rails 3 with Ruby 1.9.2


I migrated all my applications to Rails 3 with ruby 1.9.2, after I installed ruby I faced few errors.

Some of them are

1) The arrow keys were not working in irb console and “no such file to load –readline” error.

This is the problem which occurs when the readline extension is not installed with ruby source. All you have to do to fix this error is

Go to your ruby source folder you downloaded and installed ruby from.

1.  cd  ~/ruby-1.9.2 2.  cd  ext/readline

And execute the commands below.

3. ruby  extconf.rb 4. make 5. sudo make install

If you find any errors while executing ruby extconf.rb showing ..no for each checkings. Then you need to install these two libraries on your system

sudo apt-get install libncurses5-dev libreadline5-dev

then later execute the commands starting from 3.

2) The other error was after I create application and start the server, the error was “no such file to load –openssl”

Again it was the error with openssl ruby extension not installed with ruby, you can fix this error by executing the following commands.

Go to the ruby source file

1. cd  ~/ruby-1.9.2 2. cd  ext/openssl

and execute the commands below.

3. ruby extconf.rb 4. make 5. sudo make install

If you find any errors while executing the command ruby extconf.rb showing ..no for each checkings, then you need to install the package in your system

sudo apt-get install openssl libopenssl-ruby libssl-dev

Then later execute the commands starting from 3.

Similarly I found many other files which were causing errors since the extensions were not installed like zlib etc.

If you find ‘no such file to load error ‘ for any of the extensions, then you need to go to ruby source folder. Go to respective directory inside ext/ (eg: readline/ for ‘no such file to load –readline’) and execute the following commands inside that folder

ruby extconf.rb make sudo make install

If you cannot successfully execute ruby extconf.rb, then you need to install respective libraries and execute these commands above again.

Read more: Problems faced while Setting up Rails 3 with Ruby 1.9.2

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s