首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Mongoid + MongoHQ + Heroku错误

Mongoid + MongoHQ + Heroku错误
EN

Stack Overflow用户
提问于 2012-12-02 13:56:17
回答 1查看 284关注 0票数 1

您好,这是我第一次使用mongoid + mongoHQ在heroku上部署应用程序

我设法推送到heroku,但我的应用程序有一个错误,我检查了heroku日志,结果如下所示

代码语言:javascript
复制
    2012-12-02T05:36:43+00:00 app[web.1]: Processing by HomeController#index as HTML
2012-12-02T05:36:43+00:00 app[web.1]:   Rendered home/_store_search.html.erb (1.4ms)
2012-12-02T05:36:43+00:00 app[web.1]:     7: 
2012-12-02T05:36:43+00:00 app[web.1]:     9:        <div class="store">
2012-12-02T05:36:43+00:00 app[web.1]: 
2012-12-02T05:36:43+00:00 app[web.1]: 
2012-12-02T05:36:43+00:00 app[web.1]: ActionView::Template::Error (undefined method `[]' for nil:NilClass):
2012-12-02T05:36:43+00:00 app[web.1]:     6:    <h4 align="center">Best of Yelp Stores </h4>
2012-12-02T05:36:43+00:00 heroku[router]: at=info method=GET path=/ host=evening-bayou-5137.herokuapp.com fwd=128.54.34.17 dyno=web.1 queue=0 wait=0ms connect=1ms service=332ms status=500 bytes=643
2012-12-02T05:36:43+00:00 app[web.1]:     11:           
2012-12-02T05:36:43+00:00 app[web.1]:   Rendered home/index.html.erb within layouts/application (102.9ms)
2012-12-02T05:36:43+00:00 app[web.1]:   app/views/home/index.html.erb:8:in `sort_by'
2012-12-02T05:36:43+00:00 app[web.1]: 
2012-12-02T05:36:43+00:00 app[web.1]:     5: 
2012-12-02T05:36:43+00:00 app[web.1]: Completed 500 Internal Server Error in 180ms
2012-12-02T05:36:43+00:00 app[web.1]:     8:    <% @stores.sort_by{ |store| store.avg_rating || 0}.reverse.each.with_index do |store, index| %>
2012-12-02T05:36:43+00:00 app[web.1]:     10:           
2012-12-02T05:36:43+00:00 app[web.1]:   app/views/home/index.html.erb:8:in `_app_views_home_index_html_erb__1734857390086193972_44325160'
2012-12-02T05:36:44+00:00 heroku[router]: at=info method=GET path=/favicon.ico host=evening-bayou-5137.herokuapp.com fwd=128.54.34.17 dyno=web.1 queue=0 wait=0ms connect=0ms service=7ms status=200 bytes=0
2012-12-02T05:41:38+00:00 heroku[api]: Starting process with command `bundle exec rails console` by jsabilla@ucsd.edu
2012-12-02T05:41:45+00:00 heroku[run.9005]: Starting process with command `bundle exec rails console`
2012-12-02T05:41:45+00:00 heroku[run.9005]: Awaiting client
2012-12-02T05:41:45+00:00 heroku[run.9005]: State changed from starting to up
2012-12-02T05:46:25+00:00 heroku[run.9005]: Client connection closed. Sending SIGHUP to all processes
2012-12-02T05:46:26+00:00 heroku[run.9005]: Process exited with status 0
2012-12-02T05:46:26+00:00 heroku[run.9005]: State changed from up to complete
2012-12-02T05:46:35+00:00 heroku[api]: Starting process with command `bundle exec rake db:setup` by jsabilla@ucsd.edu
2012-12-02T05:46:40+00:00 heroku[run.8128]: State changed from starting to up
2012-12-02T05:46:55+00:00 heroku[run.8128]: State changed from up to complete
2012-12-02T05:47:01+00:00 heroku[api]: Starting process with command `bundle exec rake db:setup --trace` by jsabilla@ucsd.edu
2012-12-02T05:47:09+00:00 heroku[run.7343]: Awaiting client
2012-12-02T05:47:09+00:00 heroku[run.7343]: Starting process with command `bundle exec rake db:setup --trace`
2012-12-02T05:47:10+00:00 heroku[run.7343]: State changed from starting to up
2012-12-02T05:47:25+00:00 heroku[run.7343]: Process exited with status 1
2012-12-02T05:47:25+00:00 heroku[run.7343]: State changed from up to complete

最初我认为这是因为我的db是空的,所以我尝试运行: heroku运行db:seed,它给了我一个未定义的错误nil类

在这一点上,任何输入都会有所帮助。谢谢你

EN

回答 1

Stack Overflow用户

发布于 2012-12-02 14:04:02

Mongoid在Ruby 1.9.2上运行时会抛出这个异常。你需要告诉Heroku使用1.9.3,只要把这个放到你的Gemfile

代码语言:javascript
复制
ruby "1.9.3"
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/13666817

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档