Cannot get "rails console" to work on ubuntu 11.10

I want to use the rails console and I am using ubuntun 11.10, I have now found the problem

Error

:

completion.rb:9:in `require': no such file to load -- readline (LoadError) 

and I found a way to solve it:

http://blog.jasonmeridth.com/2010/11/25/readline-error-with-rvm-and-rails-3.html

but it seems that in ubuntu 11.10 libreadline5-dev is skipped and replaced with version 6

I installed version 6 and also got version 5 of

https://launchpad.net/ubuntu/oneiric/i386/libreadline-gplv2-dev/5.2-9ubuntu1

but when trying to run the following code:

 ruby extconf.rb 

I will get the following lines:

 checking for tgetnum() in -lncurses... yes checking for readline/readline.h... yes checking for readline/history.h... yes checking for readline() in -lreadline... no checking for readline() in -ledit... no checking for editline/readline.h... no 

No is my problem, so how can I solve this problem?

+6
source share
2 answers

Ubuntu 11.10 uses the new readline library, which does not sync with the readline package offered by rvm

To solve this problem (if you are using a single-user rvm installation):

1) make sure you have installed the ubuntus readline and editline dev packages

 sudo apt-get install libreadline6 libreadline6-dev 

2) configure ruby ​​readline extension to use system libraries, not rvm packages

 rvm pkg uninstall readline cd ~/.rvm/src/ruby-1.9.2-p290/ext/readline ruby extconf.rb --with-editline-dir=/usr/ --with-readline-dir=/usr/ make make install 

3) go to your project and run the rails console



Tip. You may call

 rvm requirements 

to see which Ubuntu packages must be installed to use rvm ruby

+12
source

You must install readline development packages before compiling ruby. Just run

 sudo apt-get install libreadline6-dev 

Alternative (as shown in the article you linked) you can use RVM to get the appropriate readline sources by running

 rvm package install readline 

Edit: after you have installed readline packages from the source code, you can install your rubies as follows:

 rvm install 1.9.3 --with-readline-dir="$rvm_path/usr" 

If you alredy installed a specific ruby, just use reinstall instead on install .

0
source

Source: https://habr.com/ru/post/904202/


All Articles