我正在学习 Rails,对 Macports 还很陌生。
rails server
为我的项目运行时收到以下错误:
/...config/initializers/session_store.rb:3: syntax error, unexpected ':', expecting $end
我相信这个语法错误是由于运行低于 1.9.0 的 Rails 版本造成的,因为ruby -v
给了我ruby 1.8.7
.
问题是我确定我已经安装了 ruby 1.9.3
我已经运行port clean ruby19
和各种组合来安装 ruby 1.9.3
port install ruby19
port install ruby19 -nosuffix
两者都给我以下错误:
Error: org.macports.activate for port ruby19 returned: Image error: /opt/local/bin/erb is being used by the active ruby port. Please deactivate this port first, or use 'port -f activate ruby19' to force the activation.
如果我运行,port -f activate ruby19
我会收到此错误:
---> The following versions of ruby19 are currently installed:
---> ruby19 @1.9.3-p194_3+doc (active)
---> ruby19 @1.9.3-p194_3+doc+mactk
---> ruby19 @1.9.3-p194_3+doc+nosuffix
Error: port activate failed: Registry error: Please specify the full version as recorded in the port registry.
我从这里去哪里?!
我基本上想要最快最简单的解决方案来启动和运行这个项目——我不需要在我的机器上安装多个版本的 ruby。
来吧,我知道我不能成为第一个遇到这个问题的人!RVM 真的是人们这样做的唯一方法吗?
提前谢谢了!