Rails 中的新项目(1.9.3 | 3.2.0)- 一堆错误
因此,我在 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:警告:不安全的世界可写目录/路径中的应用程序,模式040777
So I've installed rvm with rails, on Lion, and pow server running alongside with MAMP. Everything works pretty okay, until I open the index page on a fresh rails new project -d mysql
When I open up the index page, and click "about environment", I get this:
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)
Also, I get this warning every once in a while: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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来 Pow 正在使用系统的内置 Ruby (1.8),而不是您安装的 RVM。
有时,您需要通过将
.rvmrc
文件放入 Rails 应用程序的文件夹中来强制 Pow 使用 RVM Ruby(请参阅 Pow docs),内容如下:您可能需要重新启动应用程序才能使此更新生效:
It looks like Pow is using your system's built-in Ruby (1.8) instead of the RVM one you installed.
Sometimes you need to force Pow to use your RVM Ruby by putting a
.rvmrc
file in your Rails app's folder (see the Pow docs), with something like this:You may need to restart your app for this update to work: