heroku上的delayed_job rails gem错误,也许是bootstrap相关的?

时间:2012-07-07 19:56:53

标签: ruby-on-rails ruby-on-rails-3 heroku twitter-bootstrap delayed-job

出于某种原因,只需安装gem delayed_job_active_record就会导致我的heroku应用程序崩溃。

我运行了以下步骤: 添加到gem文件:

gem "delayed_job_active_record"

终端:

bundle install
rails generate delayed_job:active_record
rake db:migrate
git add .
git commit -m "added delayed_job gem"
git push
git push heroku master
heroku run rake db:migrate
heroku ps:scale worker=1

一切安装没有错误,但是当我加载页面时,我的heroku日志显示以下内容:

WARN: tilt autoloading 'sass' in a non thread-safe way; explicit require 'sass' suggested.
2012-07-07T19:47:14+00:00 app[web.1]:     5:   <%= stylesheet_link_tag    "application", :media => "all" %>
2012-07-07T19:47:14+00:00 app[web.1]:     8:   <%= yield :head %>
2012-07-07T19:47:14+00:00 app[web.1]:   (in /app/app/assets/stylesheets/custom.css.scss)):
2012-07-07T19:47:14+00:00 app[web.1]:     2: <html xmlns:fb="http://ogp.me/ns/fb#">
2012-07-07T19:47:14+00:00 app[web.1]:   app/assets/stylesheets/custom.css.scss:1
2012-07-07T19:47:14+00:00 app[web.1]: 
2012-07-07T19:47:14+00:00 app[web.1]: Completed 500 Internal Server Error in 1465ms
2012-07-07T19:47:14+00:00 app[web.1]: 
2012-07-07T19:47:14+00:00 app[web.1]: Load path: /app
2012-07-07T19:47:14+00:00 app[web.1]:     7:   <%= csrf_meta_tags %>
2012-07-07T19:47:14+00:00 app[web.1]:   app/views/layouts/application.html.erb:5:in `_app_views_layouts_application_html_erb__1868084818636776228_47102160'
2012-07-07T19:47:14+00:00 app[web.1]: ActionView::Template::Error (File to import not found or unreadable: bootstrap.

当我卸载gem时,程序回到没有错误。如果我在localhost上运行,我也没有任何问题。只有当我加载delayed_job gem时才会发生错误(即使除了安装它之外我什么都不做)

任何帮助将不胜感激!

谢谢。

1 个答案:

答案 0 :(得分:2)

对于将来想要知道的人...这解决了它:

将以下内容添加到application.rb:

config.assets.initialize_on_precompile = false