在ubuntu上使用rvm安装ruby 1.9.3

发布于 2024-12-28 01:06:30 字数 2156 浏览 4 评论 0原文

可能的重复:
Ruby 1.9.2 和 Rails 3 无法打开 Rails控制台

我已经安装了rvm和ruby 1.9.2,都工作正常。使用rvm版本1.10.2。我之前安装了 rvm 软件包 readline/zlib,但现在 readline 遇到了很大的麻烦。我正在尝试在 rvm 中安装 ruby​​ 1.9.3,但最终总是找不到 readline。

我尝试遵循不同的解决方案:

 rvm remove 1.9.3
 rvm pkg install readline
 rvm install 1.9.3 --with-readline-dir=$rvm_path/usr/ \
     --with-zlib-dir=$rvm_path/usr/

 rvm use 1.9.3
 rvmsudo gem install bundler
 bundle install (all gems installed fine)
 rails c / rails s 
 .rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/irb/completion.rb:9:in `require': \
     cannot load such file -- readline (LoadError)

我安装了 libreadline-dev (版本 6,当前版本)(这些软件包几乎需要的所有内容)

我还尝试了以下操作:

.rvm/src/ruby-1.9.3-p0/ext/readline]$ 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

.rvm/src/ruby-1.9.3-p0/ext/readline]$ ruby extconf.rb \
    --with-readline-dir=/home/claudiocontin/.rvm/usr/
 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

 .rvm/src/ruby-1.9.3-p0/ext/readline]$ ruby extconf.rb \
    --with-readline-lib=/home/claudiocontin/.rvm/usr/
 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

当然没有生成 Makefile ...

 apt-get install libreadline-dev
 Reading package lists... Done
 Building dependency tree       
 Reading state information... Done
 libreadline-dev is already the newest version.

想法?

Possible Duplicate:
Ruby 1.9.2 and Rails 3 cannot open rails console

I have already installed rvm and ruby 1.9.2, both working properly. Using rvm version 1.10.2. I previously installed the rvm packages readline/zlib, but now I'm having big troubles with readline now. I'm trying to install ruby 1.9.3 in rvm, but I always end up having readline not found.

I tried to follow different solutions:

 rvm remove 1.9.3
 rvm pkg install readline
 rvm install 1.9.3 --with-readline-dir=$rvm_path/usr/ \
     --with-zlib-dir=$rvm_path/usr/

 rvm use 1.9.3
 rvmsudo gem install bundler
 bundle install (all gems installed fine)
 rails c / rails s 
 .rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/irb/completion.rb:9:in `require': \
     cannot load such file -- readline (LoadError)

I have libreadline-dev (version 6, the current one) installed (everything needed by those packages pretty much)

I also tried the following:

.rvm/src/ruby-1.9.3-p0/ext/readline]$ 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

.rvm/src/ruby-1.9.3-p0/ext/readline]$ ruby extconf.rb \
    --with-readline-dir=/home/claudiocontin/.rvm/usr/
 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

 .rvm/src/ruby-1.9.3-p0/ext/readline]$ ruby extconf.rb \
    --with-readline-lib=/home/claudiocontin/.rvm/usr/
 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

Makefile is not generated of course ...

 apt-get install libreadline-dev
 Reading package lists... Done
 Building dependency tree       
 Reading state information... Done
 libreadline-dev is already the newest version.

Ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

娇女薄笑 2025-01-04 01:06:31

我尝试执行 rvm pkg readline、安装 ubuntu pkgs 等,但没有成功。对我有用的:

gem install rb-readline

并将以下行添加到您的 Gemfile 中:

gem 'rb-readline'

I tried to do rvm pkg readline, install ubuntu pkgs etc without any success. What worked for me:

gem install rb-readline

And add the following line to your Gemfile:

gem 'rb-readline'
把昨日还给我 2025-01-04 01:06:31

我最终做的是从 rvm usr/lib/ 路径中删除所有 libreadline 。

手动下载安装的 libreadline5-dev 软件包(在本例中为 .deb),因为新的 ubuntu 发行版只有 libreadline6-dev 作为候选。

转到rvm ruby​​ 1.9.3 src并且:

ruby extconf.rb --with-editline-dir=/usr/ --with-readline-dir=/usr/
make
sudo make install

现在工作起来就像一个魅力。

非常痛苦的东西:)

编辑:

还要记住 readline 现在也使用 libeditline-dev ,您可以在配置 ruby​​ readline 时手动禁用,传递: --disable-libedit

 ruby extconf --disable-libedit

What I ended up doing is remove all the libreadline from rvm usr/lib/ path.

Installed libreadline5-dev package (.deb in this case) downloaded manually, because the new ubuntu distro has only libreadline6-dev as candidate.

went to rvm ruby 1.9.3 src and:

ruby extconf.rb --with-editline-dir=/usr/ --with-readline-dir=/usr/
make
sudo make install

Now works like a charm.

Very painful stuff :)

edit:

also keep in mind that readline uses also libeditline-dev now, you can disable manually when configure ruby readline , passing: --disable-libedit

 ruby extconf --disable-libedit
蓬勃野心 2025-01-04 01:06:31

我一直觉得让 RVM 与包很好地配合有点像巫术。很多时候,这是关于捕获依赖项 - 我整理了一个我过去很幸运的脚本,试试这个:

sudo apt-get install zlib1g-dev libssl-dev libsqlite3-dev libmysqlclient-dev imagemagick librmagick-ruby libxml2-dev libxslt1-dev build-essential openssl libreadline6 libreadline6-dev zlib1g libyaml-dev libsqlite3-0 sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison libpq-dev libpq5 libmysql-ruby libmysqlclient-dev

rvm pkg install autoconf
rvm pkg install zlib
rvm pkg install readline
rvm pkg install openssl
rvm pkg install iconv
rvm install 1.9.3
rvm use 1.9.3 --default

I've always found getting RVM to play nicely with packages to be a bit of voodoo. A lot of times, it's about catching a dependency - I put together a script that I've had luck with in past, try this:

sudo apt-get install zlib1g-dev libssl-dev libsqlite3-dev libmysqlclient-dev imagemagick librmagick-ruby libxml2-dev libxslt1-dev build-essential openssl libreadline6 libreadline6-dev zlib1g libyaml-dev libsqlite3-0 sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison libpq-dev libpq5 libmysql-ruby libmysqlclient-dev

rvm pkg install autoconf
rvm pkg install zlib
rvm pkg install readline
rvm pkg install openssl
rvm pkg install iconv
rvm install 1.9.3
rvm use 1.9.3 --default
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文