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

发布于 2024-12-29 01:59:34 字数 1063 浏览 1 评论 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦里°也失望 2025-01-05 01:59:34

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

有时,您需要通过将 .rvmrc 文件放入 Rails 应用程序的文件夹中来强制 Pow 使用 RVM Ruby(请参阅 Pow docs),内容如下:

rvm 1.9.3

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

touch tmp/restart.txt

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:

rvm 1.9.3

You may need to restart your app for this update to work:

touch tmp/restart.txt
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文