Heroku 的问题
我在 Heroku 上运行应用程序时遇到问题。它总是向我显示此错误:
https://gist.github.com/902104
我认为这是一个这里有重要的一行,那就是:
2011-04-04T10:50:59-07:00 app[web.1]: /app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in `require': /app/app/models/gallery.rb:5: syntax error, unexpected ':', expecting kEND (SyntaxError)
但是我的 gallery.rb 文件没问题,这里是:
class Gallery < ActiveRecord::Base
has_many :gallery_photos
accepts_nested_attributes_for :gallery_photos
belongs_to :content
end
那么出了什么问题?
更新:这里是 git push heroku 的警告:
警告:您没有指定任何要推送的引用规范,当前远程
警告:尚未配置任何推送引用规范。此 warning: case 中的默认操作
是推送所有匹配的 refspec,即
本地和远程存在的所有分支 warning: 将被更新。这可能会
警告:不一定是您想要发生的事情。
warning:
警告:您可以指定在这种情况下要采取的操作,并
警告:避免再次看到此消息,方法是将 'push.default' 配置为:
warning: 'nothing' :不要推送任何内容
warning: 'matching' :推送所有匹配的分支(默认)
warning: 'tracking' :将当前分支推送到正在跟踪的任何分支
warning: 'current' :推送当前分支
I'm having problems with running my application on Heroku. It always shows me this error:
https://gist.github.com/902104
I think that is an important line here, that is:
2011-04-04T10:50:59-07:00 app[web.1]: /app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in `require': /app/app/models/gallery.rb:5: syntax error, unexpected ':', expecting kEND (SyntaxError)
But my gallery.rb file is ok, here it is:
class Gallery < ActiveRecord::Base
has_many :gallery_photos
accepts_nested_attributes_for :gallery_photos
belongs_to :content
end
So what's going wrong?
Update: here is the warnings of the git push heroku:
warning: You did not specify any refspecs to push, and the current remote
warning: has not configured any push refspecs. The default action in this
warning: case is to push all matching refspecs, that is, all branches
warning: that exist both locally and remotely will be updated. This may
warning: not necessarily be what you want to happen.
warning:
warning: You can specify what action you want to take in this case, and
warning: avoid seeing this message again, by configuring 'push.default' to:
warning: 'nothing' : Do not push anything
warning: 'matching' : Push all matching branches (default)
warning: 'tracking' : Push the current branch to whatever it is tracking
warning: 'current' : Push the current branch
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你能确保heroku使用的是最新的代码吗?
如果仍然不能解决问题,那么它可能是一个文本编码问题,因为 gallery.rb文件看起来确实不错,然后尝试获取heroku 看到的代码:
这将创建一个名为heroku 的目录——进入该目录并检查category.rb 文件。
如果仍然失败——请使用 Heroku 支持。他们会帮助找到问题。
Can you make sure that heroku is using the latest code?
If that still doesn't fix it, then it's likely a text encoding problem, since the gallery.rb file does look fine, then try to get the code as heroku sees it:
This will create a directory called heroku -- go in there and examine the category.rb file.
And if that still fails -- go with Heroku support. They'll help find the problem.