使用 RVM 安装 Ruby 1.9.2 不起作用
当我执行 >rvm install 1.9.2 时,一切顺利。然后我使用 >rvm use 1.9.2,这也很顺利。
不过,当谈到 ruby -v 时..
sam@sjones:~$ rvm install 1.9.2
/home/sam/.rvm/rubies/ruby-1.9.2-p136, this may take a while depending on your cpu(s)...
ruby-1.9.2-p136 - #fetching
ruby-1.9.2-p136 - #downloading ruby-1.9.2-p136, 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 8612k 100 8612k 0 0 562k 0 0:00:15 0:00:15 --:--:-- 1305k
ruby-1.9.2-p136 - #extracting ruby-1.9.2-p136 to /home/sam/.rvm/src/ruby-1.9.2-p136
ruby-1.9.2-p136 - #extracted to /home/sam/.rvm/src/ruby-1.9.2-p136
ruby-1.9.2-p136 - #configuring
ruby-1.9.2-p136 - #compiling
ruby-1.9.2-p136 - #installing
ruby-1.9.2-p136 - updating #rubygems for /home/sam/.rvm/gems/ruby-1.9.2-p136@global
ruby-1.9.2-p136 - updating #rubygems for /home/sam/.rvm/gems/ruby-1.9.2-p136
ruby-1.9.2-p136 - adjusting #shebangs for (gem).
ruby-1.9.2-p136 - #importing default gemsets (/home/sam/.rvm/gemsets/)
Install of ruby-1.9.2-p136 - #complete
sam@sjones:~$ rvm use 1.9.2
Using /home/sam/.rvm/gems/ruby-1.9.2-p136
sam@sjones:~$ ruby -v
-bash: ruby: command not found
我到底该怎么做?我已经尝试了几个小时了
——编辑——
这是我的 rvm 信息输出:
rvm info
system:
system:
uname: "Linux sjones 2.6.18-194.8.1.el5.028stab070.2 #1 SMP Tue Jul 6 14:55:39 MSD 2010 x86_64 GNU/Linux"
bash: "/bin/bash => GNU bash, version 3.2.39(1)-release (x86_64-pc-linux-gnu)"
zsh: " => not installed"
rvm:
version: "rvm 1.2.2 by Wayne E. Seguin ([email protected]) [http://rvm.beginrescueend.com/]"
homes:
gem: "not set"
ruby: "not set"
binaries:
ruby: ""
irb: "/usr/local/bin/irb"
gem: ""
rake: "/usr/bin/rake"
environment:
PATH: "/usr/local/bin:/usr/bin:/bin:/usr/games:/home/sam/.rvm/bin:/home/sam/.rvm/bin"
GEM_HOME: ""
GEM_PATH: ""
MY_RUBY_HOME: ""
IRBRC: ""
RUBYOPT: ""
gemset: ""
When I do >rvm install 1.9.2 it all goes well. Then I do >rvm use 1.9.2 and that goes well too.
When It comes to ruby -v though..
sam@sjones:~$ rvm install 1.9.2
/home/sam/.rvm/rubies/ruby-1.9.2-p136, this may take a while depending on your cpu(s)...
ruby-1.9.2-p136 - #fetching
ruby-1.9.2-p136 - #downloading ruby-1.9.2-p136, 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 8612k 100 8612k 0 0 562k 0 0:00:15 0:00:15 --:--:-- 1305k
ruby-1.9.2-p136 - #extracting ruby-1.9.2-p136 to /home/sam/.rvm/src/ruby-1.9.2-p136
ruby-1.9.2-p136 - #extracted to /home/sam/.rvm/src/ruby-1.9.2-p136
ruby-1.9.2-p136 - #configuring
ruby-1.9.2-p136 - #compiling
ruby-1.9.2-p136 - #installing
ruby-1.9.2-p136 - updating #rubygems for /home/sam/.rvm/gems/ruby-1.9.2-p136@global
ruby-1.9.2-p136 - updating #rubygems for /home/sam/.rvm/gems/ruby-1.9.2-p136
ruby-1.9.2-p136 - adjusting #shebangs for (gem).
ruby-1.9.2-p136 - #importing default gemsets (/home/sam/.rvm/gemsets/)
Install of ruby-1.9.2-p136 - #complete
sam@sjones:~$ rvm use 1.9.2
Using /home/sam/.rvm/gems/ruby-1.9.2-p136
sam@sjones:~$ ruby -v
-bash: ruby: command not found
What on earth do I do? I've been trying for a few hours now
--Edit--
Here is my rvm info output:
rvm info
system:
system:
uname: "Linux sjones 2.6.18-194.8.1.el5.028stab070.2 #1 SMP Tue Jul 6 14:55:39 MSD 2010 x86_64 GNU/Linux"
bash: "/bin/bash => GNU bash, version 3.2.39(1)-release (x86_64-pc-linux-gnu)"
zsh: " => not installed"
rvm:
version: "rvm 1.2.2 by Wayne E. Seguin ([email protected]) [http://rvm.beginrescueend.com/]"
homes:
gem: "not set"
ruby: "not set"
binaries:
ruby: ""
irb: "/usr/local/bin/irb"
gem: ""
rake: "/usr/bin/rake"
environment:
PATH: "/usr/local/bin:/usr/bin:/bin:/usr/games:/home/sam/.rvm/bin:/home/sam/.rvm/bin"
GEM_HOME: ""
GEM_PATH: ""
MY_RUBY_HOME: ""
IRBRC: ""
RUBYOPT: ""
gemset: ""
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
试试这个:
rvm --default use 1.9.2
--EDIT--
问题已解决,您需要运行:
[[ -s "$HOME/.rvm/scripts/rvm" ]] && 。 “$HOME/.rvm/scripts/rvm”
Try this:
rvm --default use 1.9.2
--EDIT--
problem fixed, you need to run:
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"