RoR应用程序的Heroku错误。 (设计?)

时间:2015-01-21 19:13:09

标签: ruby-on-rails heroku devise

我最近在我的应用的Devise edit.html页面添加了用户头像功能。该功能(整个应用程序)在本地工作。

现在我已经推送到Heroku,用户配置文件页面(设计edit.html)正在创建我不理解或知道如何处理的错误。

我曾尝试在Heroku上使用db:migrate进行迁移,并获得弃用警告,但我不认为它们是我遇到麻烦的原因,因为一切正常,本地。

弃权警告: 你在供应商/插件中有Rails 2.3风格的插件!在Rails 4.0中将删除对这些插件的支持。移出它们并将它们捆绑在Gemfile中,或者将它们作为lib / myplugin / *和config / initializers / myplugin.rb折叠到您的应用程序中。有关详细信息,请参阅发行说明:http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released。 (从/ app / Rakefile调用:7) 弃权警告: 你在供应商/插件中有Rails 2.3风格的插件!在Rails 4.0中将删除对这些插件的支持。移出它们并将它们捆绑在Gemfile中,或者将它们作为lib / myplugin / *和config / initializers / myplugin.rb折叠到您的应用程序中。有关详细信息,请参阅发行说明:http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released。 (从/ app / Rakefile调用:7)

相关日志:

2015-01-21T19:01:16.221350+00:00 app[web.1]:   Rendered devise/registrations/edit.html.erb within layouts/application (2.8ms)
2015-01-21T19:01:16.223471+00:00 app[web.1]: 
2015-01-21T19:01:16.223480+00:00 app[web.1]:     9:   <div><%= image_tag @user.avatar %></div>
2015-01-21T19:01:16.223474+00:00 app[web.1]: ActionView::Template::Error ( isn't precompiled):
2015-01-21T19:01:16.203961+00:00 app[web.1]: Started GET "/users/edit" for 71.9.233.133 at 2015-01-21 19:01:16 +0000
2015-01-21T19:01:16.223477+00:00 app[web.1]:     7:   <%= f.file_field :avatar %></div>
2015-01-21T19:01:16.223479+00:00 app[web.1]:     8:   <br />
2015-01-21T19:01:16.223483+00:00 app[web.1]:     11:   <br />
2015-01-21T19:01:16.223475+00:00 app[web.1]:     6:   <div><%= f.label :avatar %><br />
2015-01-21T19:01:16.223482+00:00 app[web.1]:     10:   
2015-01-21T19:01:16.223485+00:00 app[web.1]:     12: 
2015-01-21T19:01:16.223487+00:00 app[web.1]:   app/views/devise/registrations/edit.html.erb:9:in `block in _app_views_devise_registrations_edit_html_erb__33245494095269574_70255842973360'
2015-01-21T19:01:16.223489+00:00 app[web.1]:   app/views/devise/registrations/edit.html.erb:3:in `_app_views_devise_registrations_edit_html_erb__33245494095269574_70255842973360'
2015-01-21T19:01:16.223490+00:00 app[web.1]: 
2015-01-21T19:01:16.223492+00:00 app[web.1]: 
2015-01-21T19:01:16.210980+00:00 app[web.1]: Processing by Devise::RegistrationsController#edit as HTML
2015-01-21T19:01:16.221599+00:00 app[web.1]: Completed 500 Internal Server Error in 10.4ms

相关HTML

<div><%= f.label :avatar %><br />
  <%= f.file_field :avatar %></div>
  <br />
  <div><%= image_tag @user.avatar %></div>
  
  <br />

感谢您提供任何指导和帮助。

1 个答案:

答案 0 :(得分:1)

您正在使用头像资产获得预编译错误。尝试运行RAILS_ENV=production bundle exec rake assets:precompile,然后再次推送。

您还可以尝试将Heroku的Rails 12Factor gem(https://github.com/heroku/rails_12factor)添加到生产组中的gemfile中。这使得服务静态资产更容易一些。

This article也可能有所帮助。

相关问题