要在我的 Mac (v10.9.2) 上安装 RoR,我决定在此处按照 Ruby 1.9.2 的说明进行操作:https ://stackoverflow.com/a/8464619/2278546
“rvm install 1.9.2”花费的时间太长,所以根据对 SO 的建议,我使用“rvm requirements”通过 macports 单独安装每个要求。然后我执行了“rvm install 1.9.2”,它运行得更快了。
当我尝试执行“gem install rail”时,我收到一条错误消息说
activesupport 需要 Ruby 版本 >= 1.9.3
结果,我回去用 1.9.3 再次尝试:
rvm install 1.9.3
rvm --default 1.9.3
gem update
gem install rails
这一次,在 rails install 命令期间,安装 rails 文档的过程卡住了。我决定中断并运行它:
gem install --no-ri --no-rdoc rails
这行得通!我运行了以下内容:
rails new pong; cd pong; rails generate controller welcome index
该字符串中的最后一个命令给了我以下错误:
/Users/me/.rvm/gems/ruby-1.9.3-p545/gems/spring-1.1.2/lib/spring/sid.rb:17:in
fiddle_func': uninitialized constant Spring::SID::DL (NameError) from /Users/me/.rvm/gems/ruby-1.9.3-p545/gems/spring-1.1.2/lib/spring/sid.rb:30:in
sid' 来自 /Users/me/.rvm/gems/ ruby-1.9.3-p545/gems/spring-1.1.2/lib/spring/sid.rb:39:inpgid' from /Users/me/.rvm/gems/ruby-1.9.3-p545/gems/spring-1.1.2/lib/spring/server.rb:78:in
set_pgid' 来自 /Users/me/.rvm/gems/ruby-1.9.3-p545/gems/ spring-1.1.2/lib/spring/server.rb:34:inboot' from /Users/me/.rvm/gems/ruby-1.9.3-p545/gems/spring-1.1.2/lib/spring/server.rb:14:in
boot' 来自 /Users/me/.rvm/gems/ruby-1.9.3-p545/gems/spring-1.1.2/lib/spring/ client/run.rb:36:inblock in boot_server' from /Users/me/.rvm/gems/ruby-1.9.3-p545/gems/spring-1.1.2/lib/spring/client/run.rb:34:in
fork' 来自 /Users/me/.rvm/gems/ruby-1.9.3-p545/gems/spring-1.1.2/lib/spring/client/run.rb:34:boot_server' from /Users/me/.rvm/gems/ruby-1.9.3-p545/gems/spring-1.1.2/lib/spring/client/run.rb:18:in
来自 /Users/me/.rvm/gems/ruby-1.9.3-p545/gems/spring-1.1.2/lib/spring/client/command.rb:7:in callcall' from /Users/me/.rvm/gems/ruby-1.9.3-p545/gems/spring-1.1.2/lib/spring/client/rails.rb:23:in
' 来自 /Users/me /.rvm/gems/ruby-1.9.3-p545/gems/spring-1.1.2/lib/spring/client/command.rb:7:incall' from /Users/me/.rvm/gems/ruby-1.9.3-p545/gems/spring-1.1.2/lib/spring/client.rb:26:in
运行'来自 /Users/me/.rvm/gems/ruby-1.9.3-p545/gems/spring-1.1.2/bin/spring:48:in<top (required)>' from /Users/me/.rvm/gems/ruby-1.9.3-p545/gems/spring-1.1.2/lib/spring/binstub.rb:11:in
load' 来自 /Users/me/.rvm/gems/ruby -1.9.3-p545/gems/spring-1.1.2/lib/spring/binstub.rb:11:in<top (required)>' from /Users/me/Coding/pong/bin/spring:16:in
require' from /Users/me/Coding/pong/bin/spring:16:in<top (required)>' from bin/rails:3:in
load' from bin/ rails:3:in `'
根据阅读here和here以及其他地方的建议,我决定尝试使用不同的编译器:
port install gcc46
CC=`which gcc-mp-4.6`
rvm reinstall 1.9.3
gem install
rvm reinstall 1.9.3
这个安装也有同样的问题。