can't get “rails console” to work on ubuntu 11.10

六月ゝ 毕业季﹏ 提交于 2019-12-04 06:33:06

Ubuntu 11.10 uses newer readline library which not in sync with the readline package offered by rvm

To solve this (assuming you use single-user installation of rvm) do:

1) ensure you have installed ubuntus readline and editline dev packages

sudo apt-get install libreadline6 libreadline6-dev

2) configure ruby's readline extension to use the systems libs, not rvm's 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 start up the rails console



Tip: You can call

rvm requirements

to see what ubuntu packages should be installed to use rvm ruby

You have to install the readline development packages before compiling ruby. Just run

sudo apt-get install libreadline6-dev

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

rvm package install readline

Edit: Once you've installed the readline packages from source, you can install your rubies like this

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

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!