在ubuntu上使用rvm安装ruby 1.9.3 [英] install ruby 1.9.3 using rvm on ubuntu

查看:127
本文介绍了在ubuntu上使用rvm安装ruby 1.9.3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

我已经安装了rvm和ruby 1.9.2,它们都可以正常工作.使用rvm版本1.10.2.我以前安装了rvm软件包readline/zlib,但是现在我对readline遇到了很大的麻烦.我正在尝试在rvm中安装ruby 1.9.3,但是我总是最终没有找到readline.

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)

我已经安装了libreadline-dev(当前版本为6)(这些软件包几乎需要的所有东西)

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

我还尝试了以下方法:

.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 ...

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.

想法?

推荐答案

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

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

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

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

转到rvm ruby​​ 1.9.3 src和:

went to rvm ruby 1.9.3 src and:

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

现在像魔咒一样工作.

非常痛苦的东西:)

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

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

这篇关于在ubuntu上使用rvm安装ruby 1.9.3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆