无法获得"rails console"在Ubuntu 11.10上工作 [英] can't get "rails console" to work on ubuntu 11.10
问题描述
我想使用Rails控制台,而我正在使用ubuntun 11.10,目前我已发现问题
I want to use rails console and I'm using ubuntun 11.10 currently I have found the issue
错误是什么:
completion.rb:9:in `require': no such file to load -- readline (LoadError)
我找到了解决方法:
http://blog.jasonmeridth.com/2010/11/25/readline-error-with-rvm-and-rails-3.html
但是在ubuntu 11.10中似乎缺少了libreadline5-dev并将其替换为版本6
but seems in ubuntu 11.10 the libreadline5-dev is missed and it is replaced with version 6
我安装了版本6,也从
https://launchpad.net/ubuntu/oneiric/i386/libreadline-gplv2-dev/5.2-9ubuntu1
但是,如果我尝试运行以下代码:
but yet if I try to run following code :
ruby extconf.rb
我将获得以下内容:
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
不"是我的问题,那么我该如何解决呢?
the "no"s part is my problem , so how can I solve this problem?
推荐答案
Ubuntu 11.10使用较新的readline库,该库与rvm提供的readline软件包不同步
Ubuntu 11.10 uses newer readline library which not in sync with the readline package offered by rvm
要解决此问题(假设您使用rvm的单用户安装),请执行以下操作:
To solve this (assuming you use single-user installation of rvm) do:
1)确保已安装ubuntus readline和editline开发包
1) ensure you have installed ubuntus readline and editline dev packages
sudo apt-get install libreadline6 libreadline6-dev
2)配置ruby的readline扩展以使用系统库,而不是rvm的软件包
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)转到您的项目并启动Rails控制台
3) go to your project and start up the rails console
提示:您可以致电
Tip: You can call
rvm requirements
查看使用rvm ruby应该安装哪些ubuntu软件包
to see what ubuntu packages should be installed to use rvm ruby
这篇关于无法获得"rails console"在Ubuntu 11.10上工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!