【发布时间】:2011-06-02 07:42:27
【问题描述】:
在我的开发环境(Windows 7,Ruby1.9.2p180)中,一切都可以正常工作。
但是,在使用 rvm 的 Ubuntu 10.04、Ree 1.8.7 的生产环境中,会产生以下错误。 (我正在使用passenger-apache-module 来运行应用程序。)
/home/randomapp/public_html/app/models/article.rb:14: syntax error, unexpected ':', expecting kEND field :user_id, type: Hash ^
/home/randomapp/public_html/app/models/article.rb:15: syntax error, unexpected ':', expecting kEND field :username, type: String ^
/home/randomapp/public_html/app/models/article.rb:16: syntax error, unexpected ':', expecting kEND field :title, type: String ^
/home/randomapp/public_html/app/models/article.rb:17: syntax error, unexpected ':', expecting kEND field :content, type: String ^
/home/randomapp/public_html/app/models/article.rb:18: syntax error, unexpected ':', expecting kEND field :display_content, type: String ^
这些行的代码如下
field :user_id, type: Hash
field :username, type: String
field :title, type: String
field :content, type: String
field :display_content, type: String
假设上面的行在开发中工作正常,你认为这可能是语法解析器的问题吗??? 我该如何解决这个问题?
【问题讨论】:
标签: ruby-on-rails apache2 passenger mongoid