Rails中的新项目(1.9.3 | 3.2.0) - 一堆错误

时间:2012-01-26 02:32:37

标签: ruby-on-rails ruby install installation rvm

所以我在Lion上安装了带有rails的rvm,在MAMP上运行了pow服务器。一切正常,直到我在新的rails new project -d mysql

上打开索引页面

当我打开索引页面,然后点击“关于环境”时,我明白了:

SyntaxError: /Users/hb/Projects/mon/config/initializers/session_store.rb:3: syntax error, unexpected ':', expecting $end
...sion_store :cookie_store, key: '_mon_session'
                              ^
    /Library/Ruby/Gems/1.8/gems/activesupport-  3.2.0/lib/active_support/dependencies.rb:245:in `load'
    /Library/Ruby/Gems/1.8/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:245:in `load'
    /Library/Ruby/Gems/1.8/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:236:in `load_dependency'
    /Library/Ruby/Gems/1.8/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:245:in `load'
    /Library/Ruby/Gems/1.8/gems/railties-3.2.0/lib/rails/engine.rb:588
    Show 17 more lines (<--a link)

另外,我偶尔会收到这个警告: Users/me/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.0/lib/rails/script_rails_loader.rb:11: warning: Insecure world writable dir /Applications in PATH, mode 040777

1 个答案:

答案 0 :(得分:1)

看起来Pow正在使用您系统的内置Ruby(1.8)而不是您安装的RVM。

有时您需要强制Pow使用您的RVM Ruby,方法是将.rvmrc文件放在Rails应用程序的文件夹中(参见Pow docs),如下所示:

rvm 1.9.3

您可能需要重新启动应用才能使此更新生效:

touch tmp/restart.txt