我正处于Hartl的RoR教程的开始阶段(第1.2.2节),并且在安装Ruby之后,无法正确安装RubyGems。见下面的顺序:
Hansell-Shooks-MacBook-Pro:~ hansellshook$ rvm install 1.9.2
Installing Ruby from source to: /Users/hansellshook/.rvm/rubies/ruby-1.9.2-p290, this may take a while depending on your cpu(s)...
ruby-1.9.2-p290 - #fetching
ruby-1.9.2-p290 - #extracted to /Users/hansellshook/.rvm/src/ruby-1.9.2-p290 (already extracted)
Fetching yaml-0.1.4.tar.gz to /Users/hansellshook/.rvm/archives
Extracting yaml-0.1.4.tar.gz to /Users/hansellshook/.rvm/src
Configuring yaml in /Users/hansellshook/.rvm/src/yaml-0.1.4.
Compiling yaml in /Users/hansellshook/.rvm/src/yaml-0.1.4.
Installing yaml to /Users/hansellshook/.rvm/usr
ruby-1.9.2-p290 - #configuring
ruby-1.9.2-p290 - #compiling
ruby-1.9.2-p290 - #installing
Removing old Rubygems files...
Installing rubygems-1.8.10 for ruby-1.9.2-p290 ...
Installation of rubygems completed successfully.
ruby-1.9.2-p290 - adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
ruby-1.9.2-p290 - #importing default gemsets (/Users/hansellshook/.rvm/gemsets/)
Install of ruby-1.9.2-p290 - #complete
Hansell-Shooks-MacBook-Pro:~ hansellshook$ rvm --create 1.8.7-p352@rails2tutorial
Hansell-Shooks-MacBook-Pro:~ hansellshook$ rvm --create use 1.9.2-p290@rails3tutorial
Using /Users/hansellshook/.rvm/gems/ruby-1.9.2-p290 with gemset rails3tutorial
Hansell-Shooks-MacBook-Pro:~ hansellshook$ rvm --default use 1.9.2-p290@rails3tutorial
Using /Users/hansellshook/.rvm/gems/ruby-1.9.2-p290 with gemset rails3tutorial
Hansell-Shooks-MacBook-Pro:~ hansellshook$ which gem
/Users/hansellshook/.rvm/rubies/ruby-1.9.2-p290/bin/gem
Hansell-Shooks-MacBook-Pro:~ hansellshook$ [sudo] ruby setup.rb
-bash: [sudo]: command not found
在阅读完序列后,在我看来安装Ruby 1.9.2时已经进行了安装。但是,我不能从这一点继续进行(这是安装Rails)。有人知道我可能会缺少什么吗?
答案 0 :(得分:0)
不要在sudo
左右的括号中输入内容;表示sudo
是可选的/可能没有必要/可能不适用于您的系统。您正在运行Mac,因此您可以使用它。