ubuntu 11.10 rails 3.1.3 控制台输入 rails c 一直报/home/gsm/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/irb/completion.rb:9:in require': cannot load such file -- readline (LoadError)
from /home/gsm/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/irb/completion.rb:9:in'
from /home/gsm/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.3/lib/rails/commands/console.rb:3:in require'
from /home/gsm/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.3/lib/rails/commands/console.rb:3:in'
from /home/gsm/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.3/lib/rails/commands.rb:37:in require'
from /home/gsm/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.3/lib/rails/commands.rb:37:in'
from script/rails:6:in require'
from script/rails:6:in
/home/gsm/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/irb/completion.rb:9:in `require': cannot load such file -- readline (LoadError)
from /home/gsm/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/irb/completion.rb:9:in `<top (required)>'
from /home/gsm/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.3/lib/rails/commands/console.rb:3:in `require'
from /home/gsm/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.3/lib/rails/commands/console.rb:3:in `<top (required)>'
from /home/gsm/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.3/lib/rails/commands.rb:37:in `require'
from /home/gsm/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.3/lib/rails/commands.rb:37:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Ubuntu11.10 环境下
/usr/lib/ruby/1.9.1/rubygems.rb:238:in activate': can't activate rack (~> 1.3.5, runtime) for ["actionpack-3.1.3", "rails-3.1.3"], already activated rack-1.4.0 for ["rack-cache-1.1", "actionpack-3.1.3", "rails-3.1.3"] (Gem::LoadError)
from /usr/lib/ruby/1.9.1/rubygems.rb:254:inblock in activate'
from /usr/lib/ruby/1.9.1/rubygems.rb:253:in each'
from /usr/lib/ruby/1.9.1/rubygems.rb:253:inactivate'
from /usr/lib/ruby/1.9.1/rubygems.rb:254:in block in activate'
from /usr/lib/ruby/1.9.1/rubygems.rb:253:ineach'
from /usr/lib/ruby/1.9.1/rubygems.rb:253:in activate'
from /usr/lib/ruby/1.9.1/rubygems.rb:1065:ingem'
from /usr/local/bin/rails:18:in `
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
I struggled with this same issue with Ubuntu 11.10.
In my case readline would seemingly compile properly if I used the following:
However, when I invoked irb, I would get the normal error "Unable to require readline"
Finally, based on Shane's command line, I invoked the following:
$ rvm install 1.9.3 --with-readline-dir=$rvm_usr_path --with-iconv-dir=$rvm_usr_path --with-zlib-dir=$rvm_usr_path --with-openssl-dir=$rvm_usr_path
rather than the command mentioned at http://beginrescueend.com/packages/readline/
$ rvm install 1.9.2 --with-readline-dir=$rvm_path/usr
In my case version 1.9.3 was what I wanted. And finally irb came up with a functioning readline.
Thanks to everyone here for pointing me in the right direction.
在参考文章后,安装出现如下问题:
为什么我的 rvm 不是 1.9.2?
rvm install 1.9.2
Installing Ruby from source to: /usr/share/ruby-rvm/rubies/ruby-1.9.2-p318, this may take a while depending on your cpu(s)...
ruby-1.9.2-p318 - #fetching
ruby-1.9.2-p318 - #downloading ruby-1.9.2-p318, this may take a while depending on your connection...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 8603k 100 8603k 0 0 5129 0 0:28:37 0:28:37 --:--:-- 7965
ruby-1.9.2-p318 - #extracting ruby-1.9.2-p318 to /usr/share/ruby-rvm/src/ruby-1.9.2-p318
ruby-1.9.2-p318 - #extracted to /usr/share/ruby-rvm/src/ruby-1.9.2-p318
ruby-1.9.2-p318 - #configuring
ruby-1.9.2-p318 - #compiling
ruby-1.9.2-p318 - #installing
Removing old Rubygems files...
Installing rubygems dedicated to ruby-1.9.2-p318...
Retrieving rubygems-latest-1.8
Extracting rubygems-latest-1.8 ...
ERROR: Error running 'gunzip < /usr/share/ruby-rvm/archives/rubygems-latest-1.8.tgz | tar xf - -C /usr/share/ruby-rvm/src', please read /usr/share/ruby-rvm/log/ruby-1.9.2-p318/rubygems.extract.log
Installing rubygems for /usr/share/ruby-rvm/rubies/ruby-1.9.2-p318/bin/ruby
ERROR: Error running 'GEM_PATH="/usr/share/ruby-rvm/gems/ruby-1.9.2-p318:/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@global:/usr/share/ruby-rvm/gems/ruby-1.9.2-p318:/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@global" GEM_HOME="/usr/share/ruby-rvm/gems/ruby-1.9.2-p318" "/usr/share/ruby-rvm/rubies/ruby-1.9.2-p318/bin/ruby" "/usr/share/ruby-rvm/src/rubygems-latest-1.8/setup.rb"', please read /usr/share/ruby-rvm/log/ruby-1.9.2-p318/rubygems.install.log
WARN: Installation of rubygems did not complete successfully.
ruby-1.9.2-p318 - adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
ruby-1.9.2-p318 - #importing default gemsets (/usr/share/ruby-rvm/gemsets/)
Install of ruby-1.9.2-p318 - #complete
root@gavingeng:~# rvm use 1.9.2 --default
Using /usr/share/ruby-rvm/gems/ruby-1.9.2-p318
Running /usr/share/ruby-rvm/hooks/after_use
root@gavingeng:~# rvm -v
mac 10.7.4 执行 rvm install 1.9.3 --with-readline-dir=$rvm_path/usr
Ruby (and needed base gems) for your selection will be installed shortly.
Before it happens, please read and execute the instructions below.
Please use a separate terminal to execute any additional commands.
Notes for Mac OS X 10.7.4, Xcode 4.3.3.
For MacRuby: Install LLVM first.
For JRuby: Install the JDK. See http://developer.apple.com/java/download/ # Current Java version "1.6.0_26"
For IronRuby: Install Mono >= 2.6
For Ruby 1.9.3: Install libksba # If using Homebrew, 'brew install libksba'
You can use & download osx-gcc-installer: https://github.com/kennethreitz/osx-gcc-installer
** NOTE: Currently, Node.js is having issues building with osx-gcc-installer. The only fix is to install Xcode over osx-gcc-installer.
We had reports of http://hpc.sourceforge.net/ making things work, but it looks like not easiest/safest to setup.
To use an RVM installed Ruby as default, instead of the system ruby:
我是 ubuntu12.04 按照 wiki 上的安装步骤执行到下面的代码之后就抛出这个错误了,应该怎么解决呢?
安装 readline 包
$ rvm pkg install readline
Fetching readline-5.2.tar.gz to /home/pc/.rvm/archives
Extracting readline-5.2.tar.gz to /home/pc/.rvm/src
Applying patch '/home/pc/.rvm/patches/readline-5.2/shobj-conf.patch'...
Prepare readline in /home/pc/.rvm/src/readline-5.2.
Error running 'autoreconf -is --force', please read /home/pc/.rvm/log/readline/autoreconf.log
Configuring readline in /home/pc/.rvm/src/readline-5.2.
Compiling readline in /home/pc/.rvm/src/readline-5.2.
Installing readline to /home/pc/.rvm/usr
Please note that it's required to reinstall all installed rubies:
rvm reinstall $(rvm list strings | tr "" ',')
rvm all-gemsets do rvm gemset pristine
在现在 gem 包时报错,怎么办?
[ruby@localhost Downloads]$ gem source -r https://rubygems.org/
source https://rubygems.org/ not present in cache
[ruby@localhost Downloads]$ gem source -a http://ruby.taobao.org
/home/ruby/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in require': no such file to load -- zlib (LoadError)
from /home/ruby/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:inrequire'
from /home/ruby/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems.rb:540:in gunzip'
from /home/ruby/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/remote_fetcher.rb:239:infetch_path'
from /home/ruby/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/spec_fetcher.rb:269:in load_specs'
from /home/ruby/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/commands/sources_command.rb:72:inexecute'
from /home/ruby/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/command.rb:278:in invoke'
from /home/ruby/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/command_manager.rb:147:inprocess_args'
from /home/ruby/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/command_manager.rb:117:in run'
from /home/ruby/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/gem_runner.rb:65:inrun'
from /home/ruby/.rvm/rubies/ruby-1.9.2-p320/bin/gem:25:in `
ubuntu 1210 遇到这个问题,要不要从装回 12.04 啊?
lifulei@cow:~$ rvm pkg install readline
Fetching readline-5.2.tar.gz to /home/lifulei/.rvm/archives
Extracting readline-5.2.tar.gz to /home/lifulei/.rvm/src
Applying patch '/home/lifulei/.rvm/patches/readline-5.2/shobj-conf.patch'...
Prepare readline in /home/lifulei/.rvm/src/readline-5.2.
Error running 'autoreconf -is --force', please read /home/lifulei/.rvm/log/readline/autoreconf.log
Configuring readline in /home/lifulei/.rvm/src/readline-5.2.
Compiling readline in /home/lifulei/.rvm/src/readline-5.2.
Installing readline to /home/lifulei/.rvm/usr
Please note that it's required to reinstall all rubies:
rvm reinstall all --force
Fetching readline-6.2.tar.gz to /home/lifulei/.rvm/archives
There is no checksum for 'http://ftp.gnu.org/gnu/readline/readline-6.2.tar.gz' or 'readline-6.2.tar.gz', it's not possible to validate it.
If you wish to continue with unverified download add '--verify-downloads 1' after the command.
Please note that it's required to reinstall all rubies:
rvm reinstall all --force
lifulei@cow:~$ rvm reinstall all --force
Removing /home/lifulei/.rvm/src/ruby-1.9.2-p320...
Removing /home/lifulei/.rvm/rubies/ruby-1.9.2-p320...
No binary rubies available for: ubuntu/12.10/i386/ruby-1.9.2-p320.
Continuing with compilation. Please read 'rvm mount' to get more information on binary rubies.
Installing Ruby from source to: /home/lifulei/.rvm/rubies/ruby-1.9.2-p320, this may take a while depending on your cpu(s)...
ruby-1.9.2-p320 - #downloading ruby-1.9.2-p320, this may take a while depending on your connection...
ruby-1.9.2-p320 - #extracting ruby-1.9.2-p320 to /home/lifulei/.rvm/src/ruby-1.9.2-p320
ruby-1.9.2-p320 - #extracted to /home/lifulei/.rvm/src/ruby-1.9.2-p320
ruby-1.9.2-p320 - #configuring
ruby-1.9.2-p320 - #compiling
ruby-1.9.2-p320 - #installing
Removing old Rubygems files...
Installing rubygems-1.8.24 for ruby-1.9.2-p320 ...
Installation of rubygems completed successfully.
Saving wrappers to '/home/lifulei/.rvm/bin'.
ruby-1.9.2-p320 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
ruby-1.9.2-p320 - #importing default gemsets (/home/lifulei/.rvm/gemsets/)
Install of ruby-1.9.2-p320 - #complete
Making gemset ruby-1.9.2-p320 pristine.
Making gemset ruby-1.9.2-p320@global pristine.
Removing /home/lifulei/.rvm/src/ruby-1.9.3-p194...
Removing /home/lifulei/.rvm/rubies/ruby-1.9.3-p194...
No binary rubies available for: ubuntu/12.10/i386/ruby-1.9.3-p194.
Continuing with compilation. Please read 'rvm mount' to get more information on binary rubies.
Installing Ruby from source to: /home/lifulei/.rvm/rubies/ruby-1.9.3-p194, this may take a while depending on your cpu(s)...
ruby-1.9.3-p194 - #downloading ruby-1.9.3-p194, this may take a while depending on your connection...
ruby-1.9.3-p194 - #extracting ruby-1.9.3-p194 to /home/lifulei/.rvm/src/ruby-1.9.3-p194
ruby-1.9.3-p194 - #extracted to /home/lifulei/.rvm/src/ruby-1.9.3-p194
ruby-1.9.3-p194 - #configuring
ruby-1.9.3-p194 - #compiling
ruby-1.9.3-p194 - #installing
Removing old Rubygems files...
Installing rubygems-1.8.24 for ruby-1.9.3-p194 ...
Installation of rubygems completed successfully.
Saving wrappers to '/home/lifulei/.rvm/bin'.
ruby-1.9.3-p194 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
ruby-1.9.3-p194 - #importing default gemsets (/home/lifulei/.rvm/gemsets/)
Install of ruby-1.9.3-p194 - #complete
Making gemset ruby-1.9.3-p194 pristine.
Making gemset ruby-1.9.3-p194@global pristine.
lifulei@cow:~$
第一个,在切换 ruby1.9.3 版本时,用 rvm 1.9.3 --default 命令出现以下错误提示:
RVM is not a function, selecting rubies with 'rvm use ...' will not work.
You need to change your terminal emulator preferences to allow login shell.
Sometimes it is required to use /bin/bash --login as the command.
Please visit https://rvm.io/integration/gnome-terminal/ for a example.
在 ubuntu 14.04 ==> zsh 中,如果一直出现这个问题,
You need to change your terminal emulator preferences to allow login shell.
Sometimes it is required to use /bin/bash --login as the command.
Please visit https://rvm.io/integration/gnome-terminal/ for a example.
@huacnlee 要不要考虑配合上 rvm gemset 呢?
我觉得既然这是个 Quickstart Guide 就暂时不加 gemset 为好。我个人是在项目多而且使用 gem 有较大差异时才接触了 gemset。
我现在最重要的是生产环境。多讲点。详细点呀哈。新手压力很大呀。
小弟是在 win32 中装个 colinux 跑的....
用 Bundler 管理 gem 挺方便的,感觉不需要再弄个 gemset 了,rvm 还是用户管理 ruby 就好了,呵呵。
Windows 下搞 ruby 有一个变通的方法,就是装一个虚拟机(Virtual Box 蛮好用),虚拟机装的是 Linux,然后通过 Samba 共享文件出来给 Windows 的 IDE 修改,这样 Ruby 程序执行的环境还是 Linux。 我现在就是这么弄的,感觉还蛮方便的。
新手有个问题:安装 passenger 的 Nigx 的时候,需要 sudo 权限;但是 sudo 的话,rvm 及相关的命令都不可见。一般怎么设置?
@Magic 用 rvmsudo
ubuntu 11.10 rails 3.1.3 控制台输入 rails c 一直报/home/gsm/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/irb/completion.rb:9:in
' Bash 代码require': cannot load such file -- readline (LoadError) from /home/gsm/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/irb/completion.rb:9:in
' from /home/gsm/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.3/lib/rails/commands/console.rb:3:inrequire' from /home/gsm/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.3/lib/rails/commands/console.rb:3:in
' from /home/gsm/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.3/lib/rails/commands.rb:37:inrequire' from /home/gsm/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.3/lib/rails/commands.rb:37:in
' from script/rails:6:inrequire' from script/rails:6:in
sudo apt-get install libncurses5-dev libreadline5-dev
但是实践发现 libreadline5-dev 已经废弃了 有谁知道怎么解决啊???
ubuntu 11.10 rails 3.1.3 控制台输入 rails c 一直报
Bash 代码
但是实践发现 libreadline5-dev 已经废弃了 有谁知道怎么解决啊???
@Jsiguo 看我发的帖子 http://ruby-china.org/topics/384
@Jsiguo 那就装 libreadline6-dev
@huacnlee 为啥要加 sudo? 「sudo gem install bundler rails」
Ubuntu11.10 环境下 /usr/lib/ruby/1.9.1/rubygems.rb:238:in
'activate': can't activate rack (~> 1.3.5, runtime) for ["actionpack-3.1.3", "rails-3.1.3"], already activated rack-1.4.0 for ["rack-cache-1.1", "actionpack-3.1.3", "rails-3.1.3"] (Gem::LoadError) from /usr/lib/ruby/1.9.1/rubygems.rb:254:in
block in activate' from /usr/lib/ruby/1.9.1/rubygems.rb:253:ineach' from /usr/lib/ruby/1.9.1/rubygems.rb:253:in
activate' from /usr/lib/ruby/1.9.1/rubygems.rb:254:inblock in activate' from /usr/lib/ruby/1.9.1/rubygems.rb:253:in
each' from /usr/lib/ruby/1.9.1/rubygems.rb:253:inactivate' from /usr/lib/ruby/1.9.1/rubygems.rb:1065:in
gem' from /usr/local/bin/rails:18:in `分享经验: 1.由于伟大的墙,下载 RVM 的过程可能报错,需要翻墙安装; 2.Mac 系统下,按教程里的方法使用 RVM 安装 ruby1.9.2 支持,可是安装 1.9.3 会报错。解决办法:
$ rvm install 1.9.3 --with-gcc=clang
我也是运行 rails console 出错,问题和这个一样http://stackoverflow.com/questions/8583224/cant-get-rails-console-to-work-on-ubuntu-11-10 但没得到解决,请各位大侠帮忙~
Installation of RVM in /home/qiukun/.rvm/ is almost complete:
source /home/qiukun/.profile
in all your open shell windows, in rare cases you need to reopen all shell windows.少了这个可不是快速正确哦
@hutusi 按那里的一楼可行,谢谢
http://stackoverflow.com/questions/8176076/how-to-get-readline-support-in-irb-using-rvm-on-ubuntu-11-10 另一个更新 方法摘录如下 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
I struggled with this same issue with Ubuntu 11.10.
In my case readline would seemingly compile properly if I used the following:
$ rvm --skip-autoreconf pkg install readline as outlined at the bottom of http://beginrescueend.com/packages/readline/
However, when I invoked irb, I would get the normal error "Unable to require readline"
Finally, based on Shane's command line, I invoked the following:
$ rvm install 1.9.3 --with-readline-dir=$rvm_usr_path --with-iconv-dir=$rvm_usr_path --with-zlib-dir=$rvm_usr_path --with-openssl-dir=$rvm_usr_path rather than the command mentioned at http://beginrescueend.com/packages/readline/
$ rvm install 1.9.2 --with-readline-dir=$rvm_path/usr In my case version 1.9.3 was what I wanted. And finally irb came up with a functioning readline.
Thanks to everyone here for pointing me in the right direction.
楼上的方法好用,mark
安装过程如出现问题,建议使用英语进行 Google.
装了几天,终于把苹果维修站的环境搞定了
apt 安装好爽
好东西
原生 Windows 下安装方法,也不算太麻烦,就是 gem 更新还是要VPN……
gem 更新 可以用淘宝的源
@xiaogui 试了,可以用,谢谢!安装方法也更新了。
在参考文章后,安装出现如下问题: 为什么我的 rvm 不是 1.9.2? rvm install 1.9.2 Installing Ruby from source to: /usr/share/ruby-rvm/rubies/ruby-1.9.2-p318, this may take a while depending on your cpu(s)...
ruby-1.9.2-p318 - #fetching ruby-1.9.2-p318 - #downloading ruby-1.9.2-p318, this may take a while depending on your connection... % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 8603k 100 8603k 0 0 5129 0 0:28:37 0:28:37 --:--:-- 7965 ruby-1.9.2-p318 - #extracting ruby-1.9.2-p318 to /usr/share/ruby-rvm/src/ruby-1.9.2-p318 ruby-1.9.2-p318 - #extracted to /usr/share/ruby-rvm/src/ruby-1.9.2-p318 ruby-1.9.2-p318 - #configuring ruby-1.9.2-p318 - #compiling ruby-1.9.2-p318 - #installing Removing old Rubygems files... Installing rubygems dedicated to ruby-1.9.2-p318... Retrieving rubygems-latest-1.8 Extracting rubygems-latest-1.8 ... ERROR: Error running 'gunzip < /usr/share/ruby-rvm/archives/rubygems-latest-1.8.tgz | tar xf - -C /usr/share/ruby-rvm/src', please read /usr/share/ruby-rvm/log/ruby-1.9.2-p318/rubygems.extract.log Installing rubygems for /usr/share/ruby-rvm/rubies/ruby-1.9.2-p318/bin/ruby ERROR: Error running 'GEM_PATH="/usr/share/ruby-rvm/gems/ruby-1.9.2-p318:/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@global:/usr/share/ruby-rvm/gems/ruby-1.9.2-p318:/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@global" GEM_HOME="/usr/share/ruby-rvm/gems/ruby-1.9.2-p318" "/usr/share/ruby-rvm/rubies/ruby-1.9.2-p318/bin/ruby" "/usr/share/ruby-rvm/src/rubygems-latest-1.8/setup.rb"', please read /usr/share/ruby-rvm/log/ruby-1.9.2-p318/rubygems.install.log WARN: Installation of rubygems did not complete successfully. ruby-1.9.2-p318 - adjusting #shebangs for (gem irb erb ri rdoc testrb rake). ruby-1.9.2-p318 - #importing default gemsets (/usr/share/ruby-rvm/gemsets/) Install of ruby-1.9.2-p318 - #complete root@gavingeng:~# rvm use 1.9.2 --default Using /usr/share/ruby-rvm/gems/ruby-1.9.2-p318 Running /usr/share/ruby-rvm/hooks/after_use root@gavingeng:~# rvm -v
rvm 1.6.9 by Wayne E. Seguin ([email protected]) [https://rvm.beginrescueend.com/]
Ubuntu 的要注意啦,安装过程中用到‘.bash_profile’的要变更下,另外还得配个路径。具体参考 http://stackoverflow.com/questions/8663936/how-do-i-change-my-ruby-version-using-rvm
用的 ubuntu 11.10,折腾了 2 天了,出现了好多问题,最开始用 root 安装的 rvm。。。真的是后果自负
安装完 rvm 之后提示 source /etc/profile.d/rvm.sh 把 source /etc/profile.d/rvm.sh 添加到~/.bashrc 中 然后 source ~/.bashrc
rails server 的时候出现 Could not find a JavaScript runtime 错误
需要在 Gemfile 中添加 gem "execjs" 和 gem "therubyracer" 然后 bundle install 终于弄好了
新版的 Xcode 不要忘了
xcode-select
@huacnlee楼上是我发的。。。github 账号连过来就错了。。。
@huacnlee
source ~/.bash_profile
=>source ~/.rvm/scripts/'rvm'
?@ruby_sky source ~/.bash_profile => source ~/.rvm/scripts/rvm
http://www.cnblogs.com/keen-allan/archive/2012/04/22/2464541.html 小弟经过测试 在 Ubuntu 12.04 搭建 Ruby on Rails 开发环境的基本教程。
搞定
$ rvm install 1.9.2 --with-readline-dir=$rvm_path/usr
这里的$rvm_path 标成了蓝色,是指要换成我自己安装的目录吗?可是在此步骤之前也没有任何需要我指定的地方啊正确安装。。。没遇到问题 12.04 thx
顶一下 领教
安装完后,rvm ruby gem 都正常,就是 rails 再次开启终端的时候提示没安装,写的不仔细啊
【接上】gem list 也可以查到 bundle 和 rails
h2. 请在使用本教程安装之前确保你的电脑里面没有安装 ruby gem bundle 等 特别是在 usr 目录下。由于系统路径的优先顺序,/usr 目录下的同名可执行文件会优先执行,导致很多奇怪的问题。
同上,我也是这样的问题
建议在 ubuntu 的开发包上加上 libsqlite3-dev libsqlite3-ruby 少了这两个包,可能建立 rails 项目时会在 run bundle install 那里出现 ERROR: Failed to build gem native extension.
第四步中:将https://rubygems.org 改为 http
安装到这里: rvm pkg install readline
出现以下错误: http://pastie.org/4290572
@1272729223 显然是因为你没有装上 make
gem install mysql2 出错 还需要 sudo apt-get install libmysql-ruby libmysqlclient-dev 希望加上
mac 10.7.4 执行 rvm install 1.9.3 --with-readline-dir=$rvm_path/usr
Ruby (and needed base gems) for your selection will be installed shortly. Before it happens, please read and execute the instructions below. Please use a separate terminal to execute any additional commands.
Notes for Mac OS X 10.7.4, Xcode 4.3.3.
For MacRuby: Install LLVM first. For JRuby: Install the JDK. See http://developer.apple.com/java/download/ # Current Java version "1.6.0_26" For IronRuby: Install Mono >= 2.6 For Ruby 1.9.3: Install libksba # If using Homebrew, 'brew install libksba' You can use & download osx-gcc-installer: https://github.com/kennethreitz/osx-gcc-installer ** NOTE: Currently, Node.js is having issues building with osx-gcc-installer. The only fix is to install Xcode over osx-gcc-installer. We had reports of http://hpc.sourceforge.net/ making things work, but it looks like not easiest/safest to setup. To use an RVM installed Ruby as default, instead of the system ruby:
:
按照教程来的 执行 rvm install 1.9.3 --with-readline-dir=$rvm_path/usr 时候报如上提示
rvm --skip-autoreconf pkg install readline 是不是应该这样? @huacnlee 我遇到的问题:http://pastie.org/4449824
我想问的是安装到这一步时,需要等待多久啊…………
rvm install 1.9.3 --with-readline-dir=$rvm_path/usr
我是 ubuntu12.04 按照 wiki 上的安装步骤执行到下面的代码之后就抛出这个错误了,应该怎么解决呢?
安装 readline 包
$ rvm pkg install readline
Fetching readline-5.2.tar.gz to /home/pc/.rvm/archives
Extracting readline-5.2.tar.gz to /home/pc/.rvm/src
Applying patch '/home/pc/.rvm/patches/readline-5.2/shobj-conf.patch'... Prepare readline in /home/pc/.rvm/src/readline-5.2. Error running 'autoreconf -is --force', please read /home/pc/.rvm/log/readline/autoreconf.log Configuring readline in /home/pc/.rvm/src/readline-5.2. Compiling readline in /home/pc/.rvm/src/readline-5.2. Installing readline to /home/pc/.rvm/usr Please note that it's required to reinstall all installed rubies:
rvm reinstall $(rvm list strings | tr "" ',') rvm all-gemsets do rvm gemset pristine
求收藏按钮
受益颇多,对于新手来说简单易懂
你好,这个确实很好,我的一台 linux 就是这样安装成功的。谢谢了。但我在装我的另一台 linux 时,在步骤 1 安装 rvm 时,好像是漏执行了某个命令,导致 rvm 没装上,然后按照命令行的提示进行安装 rvm,结果 rvm 装是装上了,但版本是 1.6.9 的。所以接下去的步骤也进行不下去了。我想卸载这个 rvm 或者升级到你这里同样的版本,要怎么弄啊?能否告知下,感激不尽。
good 很喜欢
如果是 Mountain Lion,请看这里: https://github.com/xiaolai/laptop
在现在 gem 包时报错,怎么办? [ruby@localhost Downloads]$ gem source -r https://rubygems.org/ source https://rubygems.org/ not present in cache [ruby@localhost Downloads]$ gem source -a http://ruby.taobao.org /home/ruby/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in
'require': no such file to load -- zlib (LoadError) from /home/ruby/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in
require' from /home/ruby/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems.rb:540:ingunzip' from /home/ruby/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/remote_fetcher.rb:239:in
fetch_path' from /home/ruby/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/spec_fetcher.rb:269:inload_specs' from /home/ruby/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/commands/sources_command.rb:72:in
execute' from /home/ruby/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/command.rb:278:ininvoke' from /home/ruby/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/command_manager.rb:147:in
process_args' from /home/ruby/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/command_manager.rb:117:inrun' from /home/ruby/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/gem_runner.rb:65:in
run' from /home/ruby/.rvm/rubies/ruby-1.9.2-p320/bin/gem:25:in `ubuntu 1210 遇到这个问题,要不要从装回 12.04 啊? lifulei@cow:~$ rvm pkg install readline Fetching readline-5.2.tar.gz to /home/lifulei/.rvm/archives Extracting readline-5.2.tar.gz to /home/lifulei/.rvm/src Applying patch '/home/lifulei/.rvm/patches/readline-5.2/shobj-conf.patch'... Prepare readline in /home/lifulei/.rvm/src/readline-5.2. Error running 'autoreconf -is --force', please read /home/lifulei/.rvm/log/readline/autoreconf.log Configuring readline in /home/lifulei/.rvm/src/readline-5.2. Compiling readline in /home/lifulei/.rvm/src/readline-5.2. Installing readline to /home/lifulei/.rvm/usr
Please note that it's required to reinstall all rubies:
rvm reinstall all --force
Fetching readline-6.2.tar.gz to /home/lifulei/.rvm/archives There is no checksum for 'http://ftp.gnu.org/gnu/readline/readline-6.2.tar.gz' or 'readline-6.2.tar.gz', it's not possible to validate it. If you wish to continue with unverified download add '--verify-downloads 1' after the command.
Please note that it's required to reinstall all rubies:
rvm reinstall all --force
lifulei@cow:~$ rvm reinstall all --force Removing /home/lifulei/.rvm/src/ruby-1.9.2-p320... Removing /home/lifulei/.rvm/rubies/ruby-1.9.2-p320... No binary rubies available for: ubuntu/12.10/i386/ruby-1.9.2-p320. Continuing with compilation. Please read 'rvm mount' to get more information on binary rubies. Installing Ruby from source to: /home/lifulei/.rvm/rubies/ruby-1.9.2-p320, this may take a while depending on your cpu(s)... ruby-1.9.2-p320 - #downloading ruby-1.9.2-p320, this may take a while depending on your connection... ruby-1.9.2-p320 - #extracting ruby-1.9.2-p320 to /home/lifulei/.rvm/src/ruby-1.9.2-p320 ruby-1.9.2-p320 - #extracted to /home/lifulei/.rvm/src/ruby-1.9.2-p320 ruby-1.9.2-p320 - #configuring ruby-1.9.2-p320 - #compiling ruby-1.9.2-p320 - #installing Removing old Rubygems files... Installing rubygems-1.8.24 for ruby-1.9.2-p320 ... Installation of rubygems completed successfully. Saving wrappers to '/home/lifulei/.rvm/bin'. ruby-1.9.2-p320 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake). ruby-1.9.2-p320 - #importing default gemsets (/home/lifulei/.rvm/gemsets/) Install of ruby-1.9.2-p320 - #complete Making gemset ruby-1.9.2-p320 pristine. Making gemset ruby-1.9.2-p320@global pristine. Removing /home/lifulei/.rvm/src/ruby-1.9.3-p194... Removing /home/lifulei/.rvm/rubies/ruby-1.9.3-p194... No binary rubies available for: ubuntu/12.10/i386/ruby-1.9.3-p194. Continuing with compilation. Please read 'rvm mount' to get more information on binary rubies. Installing Ruby from source to: /home/lifulei/.rvm/rubies/ruby-1.9.3-p194, this may take a while depending on your cpu(s)... ruby-1.9.3-p194 - #downloading ruby-1.9.3-p194, this may take a while depending on your connection... ruby-1.9.3-p194 - #extracting ruby-1.9.3-p194 to /home/lifulei/.rvm/src/ruby-1.9.3-p194 ruby-1.9.3-p194 - #extracted to /home/lifulei/.rvm/src/ruby-1.9.3-p194 ruby-1.9.3-p194 - #configuring ruby-1.9.3-p194 - #compiling ruby-1.9.3-p194 - #installing Removing old Rubygems files... Installing rubygems-1.8.24 for ruby-1.9.3-p194 ... Installation of rubygems completed successfully. Saving wrappers to '/home/lifulei/.rvm/bin'. ruby-1.9.3-p194 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake). ruby-1.9.3-p194 - #importing default gemsets (/home/lifulei/.rvm/gemsets/) Install of ruby-1.9.3-p194 - #complete Making gemset ruby-1.9.3-p194 pristine. Making gemset ruby-1.9.3-p194@global pristine. lifulei@cow:~$
替换 source 时的 zlib 问题大家是怎么解决的,我系统明明安装了 zlib 的
重新单独安装一下 readline 就 OK 了 下载 解压 安装
Download the latest version of GNU readline from http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html At the time of writing, this is readline-6.0.tar.gz
Unpack the gzipped tar file under /tmp
cd /tmp tar -zxvf readline-6.0.tar.gz Change to the directory this creates and run configure:
cd readline-6.0 ./configure If you do not have write access to the /usr/local/ hierarchy, then you can install the files somewhere else:
./configure --prefix=/home/my-user-name/packages Now build the readline library
make and install (become superuser first if installing under /usr/local)
make install
很好很强大
Errno::ETIMEDOUT: Connection timed out - connect(2) (https://ruby.taobao.org/specs.4.8.gz) 郁闷 rails 最后一步
这帖子不能收藏吗
vert good
学习了
sed 语句那里报错,说 sed:-e expression #1,char 1: unknown command: "."
ssioc@ubuntu:~$ sudo apt-get install -y build-essential openssl curl libcurl3-dev libreadline6 libreadline6-dev git zlib1g zlib1g-dev libssl-dev libyaml-dev libxml2-dev libxslt-dev autoconf automake libtool imagemagick libmagickwand-dev libpcre3-dev libsqlite3-dev libmysql-ruby libmysqlclient-de [sudo] password for ssioc: 正在读取软件包列表... 完成 正在分析软件包的依赖关系树
正在读取状态信息... 完成
注意,选取 libcurl4-openssl-dev 而非 libcurl3-dev 注意,选取 libxslt1-dev 而非 libxslt-dev E: 未发现软件包 libmysqlclient-de ssioc@ubuntu:~$ sudo apt-get install -y build-essential openssl curl libcurl3-dev libreadline6 libreadline6-dev git zlib1g zlib1g-dev libssl-dev libyaml-dev libxml2-dev libxslt-dev autoconf automake libtool imagemagick libmagickwand-dev libpcre3-dev libsqlite3-dev libmysql-ruby libmysqlclient-de [sudo] password for ssioc: 正在读取软件包列表... 完成 正在分析软件包的依赖关系树
正在读取状态信息... 完成
注意,选取 libcurl4-openssl-dev 而非 libcurl3-dev 注意,选取 libxslt1-dev 而非 libxslt-dev E: 未发现软件包 libmysqlclient-de ssioc@ubuntu:~$ sudo apt-get install -y build-essential openssl curl libcurl3-dev libreadline6 libreadline6-dev git zlib1g zlib1g-dev libssl-dev libyaml-dev libxml2-dev libxslt-dev autoconf automake libtool imagemagick libmagickwand-dev libpcre3-dev libsqlite3-dev libmysql-ruby libmysqlclient-de [sudo] password for ssioc: 正在读取软件包列表... 完成 正在分析软件包的依赖关系树
正在读取状态信息... 完成
注意,选取 libcurl4-openssl-dev 而非 libcurl3-dev 注意,选取 libxslt1-dev 而非 libxslt-dev E: 未发现软件包 libmysqlclient-de
ssioc@ubuntu:~$
按说明步骤 0 我就不成功啊 ubuntu 12.04 LTS 的.......????求助 呜呜呜呜
首先要安装 Xcode Command Line Tools,而不仅仅是 Xcode: Preferences > Downloads > Components > Command Line Tools
apt-get 之前,最好先 $sudo apt-get update 这样可以避免许多麻烦。
这个教程在 Linux 下安装有问题,我新装 UB,按照这个教程先执行第一部,安装必须的一些包,就是这句: sudo apt-get install -y build-essential openssl curl libcurl3-dev libreadline6 libreadline6-dev git zlib1g zlib1g-dev libssl-dev libyaml-dev libxml2-dev libxslt-dev autoconf automake libtool imagemagick libmagickwand-dev libpcre3-dev libsqlite3-dev libmysql-ruby libmysqlclient-dev
执行成功后,用 ruby -v 命令查看,结果是: ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
看来已经有安装了 ruby,试了试 irb,同样有效。好吧,难道这已经成功了?
接着按照教程的步骤,安装了 rvm,并安装了 ruby2.00 和 ruby1.9.3-P429,也用 rvm 2.0.0 --default 命令设置了默默认版本。
这里发现了二个错误:
第一个,在切换 ruby1.9.3 版本时,用 rvm 1.9.3 --default 命令出现以下错误提示: RVM is not a function, selecting rubies with 'rvm use ...' will not work.
You need to change your terminal emulator preferences to allow login shell. Sometimes it is required to use
/bin/bash --login
as the command. Please visit https://rvm.io/integration/gnome-terminal/ for a example.第二个:虽然装了二个 ruby,但是在终端下面执行 ruby -v 时显示的始终是: ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
请问,这样怎么再继续下去?装几个 ruby 版本又有什么用?
couldn't find package libreadline6
您好,我在 Fedora14 下,替换淘宝源的时候出错: $ sed -i .bak 's!ftp.ruby-lang.org/pub/ruby!ruby.taobao.org/mirrors/ruby!' $rvm_path/config/db sed:-e 表达式 #1,字符 1:未知的命令:“.”
怎么解决啊?
能不能指导下 为什么不能在 winddows 上面搞啊?
$ sed -i .bak 's!ftp.ruby-lang.org/pub/ruby!ruby.taobao.org/mirrors/ruby!' $rvm_path/config/db
应该改为
For Mac:
$ sed -i .bak 's!ftp.ruby-lang.org/pub/ruby!ruby.taobao.org/mirrors/ruby!' $rvm_path/config/db
For Linux:
$ sed -i 's!ftp.ruby-lang.org/pub/ruby!ruby.taobao.org/mirrors/ruby!' $rvm_path/config/db
参考资料:http://ruby.taobao.org/
rvm 现在用 autolibs 方便多了
确实简单,不过在修改 gem 源的时候应该稍加注释,并不是人人都需要修改的。
TEST
@huacnlee WIKI 的评论功能没有禁止掉 Guest 用户。
开始模仿着安装在,ubuntu 上还是有些不一样
在 ubuntu 14.04 ==> zsh 中,如果一直出现这个问题, You need to change your terminal emulator preferences to allow login shell. Sometimes it is required to use /bin/bash --login as the command. Please visit https://rvm.io/integration/gnome-terminal/ for a example.
那 你在 .zshrc 的最后一行加上 [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # This loads RVM
就好了
结合 gorails.com 安装
为什么不推荐 windows 系统,如果在 windows 系统上使用 rails 环境以后会遇到哪些问题?
步骤 0,地址已经变了~!
Whoops, the Homebrew installer has moved! Please instead run:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Also, please ask wherever you got this link from to update it to the above. Thanks!
为何强调不要在 windows 上搞呢?
受益
转载备忘
apt-get 缺少密钥的解决办法
作者:阿博 时间:2012 年 11 月 21 日 19:43 0 条评论
重装了一下系统,直接把之前备份的 apt 源拷贝过来,更新的时候提示缺少密钥,原因是一般第三方源都需要验证密钥才能使用。
举例: 由于没有公钥,下列签名无法进行验证:NO_PUBKEY 60D112172D75E850
解决办法,取上面那段 key 的最后 8 位,也就是 2D75E850,复制下来,然后:
gpg --keyserver subkeys.pgp.net --recv 2D75E850
如果提示找不到有效的 OpenPGP 数据,可以尝试更换服务器,例如 keyserver.ubuntu.com
gpg --keyserver keyserver.ubuntu.com --recv 2D75E850
gpg --export --armor 2D75E850 | sudo apt-key add -
问题解决了,再次 apt-get update 就不会提示出错了。
mac 安装可能会遇到各种问题
不管是否多余,先安装以下东东 brew install autoconf brew install automake brew install libtool brew install ap ple-gcc42 brew install libyaml brew install libxslt brew install libksba
brew install openssl
在安装,成功
Windows 下安装
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go/install)" return 404
@yihuafu brew install ap 貌似错了,
收藏
步骤 0 地址变了,请问有没有新的地址?
@huacnlee a tip, need add the command: "rvm requirements" after install RVM.
Windows 下的安装建议还是把它单独弄出来成为一个独立的帖子,而不是“不建议在 Windows 下安装”就一笔带过的。
不错,适合我这样的新手,节省时间!
这里有个坑给大家说下 出现 There was an error while trying to load the gem 'uglifier'. (Bundler::GemRequireError) 原因是缺少依赖的组件 nodejs
nvm 下载慢,安装失败,还是挂个梯子吧,码农不能少了梯子啊。试试天路外网加速器,看他们的命令行加速教程,亲测可用,速度很快。教程 https://91tianlu.cn/knowledgebase.php?action=displayarticle&id=7
想说了
打卡。
大佬您好,请教一下,使用 rvm 安装 Ruby 的时候 如何 不让它升级 ubuntu 的 依赖,(怕 gui 桌起不来,之前安装 Python 的时候碰到过)