Heroku无法识别rails 3.1的预编译资产

时间:2011-11-26 01:54:43

标签: ruby-on-rails heroku ruby-on-rails-3.1

我首先切换到单独的heroku_branch分支,以防止预编译资产“监管”我的git存储库,然后与主存储库合并

$ git checkout heroku_branch
$ git merge master

我已经完成了heroku的文档建议与预编译资产相关的内容

$ RAILS_ENV=production bundle exec rake assets:precompile

/Users/bagvoo/.rvm/rubies/ruby-1.9.2-p290/bin/ruby /Users/bagvoo/.rvm/gems/ruby-1.9.2-p290@upvote/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
/Users/bagvoo/.rvm/rubies/ruby-1.9.2-p290/bin/ruby /Users/bagvoo/.rvm/gems/ruby-1.9.2-p290@upvote/bin/rake assets:precompile:nondigest RAILS_ENV=production RAILS_GROUPS=assets

$ git add .
$ git commit -m "vendor compiled assets"

然后我使用

推送到heroku存储库
$ git push heroku master

然而,我没有得到

-----> Preparing Rails asset pipeline
       Detected manifest.yml, assuming assets were compiled locally

相反,我得到:

----> Preparing app for Rails asset pipeline
      Running: rake assets:precompile
      rake aborted!
      undefined method `blamed_files' for nil:NilClass
      (in /tmp/build_6x7f3k642z8z/vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb)

      Tasks: TOP => assets:precompile:primary
      (See full trace by running task with --trace)
      Precompiling assets failed, enabling runtime asset compilation

有一个public/assets/manifest.yml所以我不明白为什么heroku试图预先编译这些东西......

1 个答案:

答案 0 :(得分:0)

问题在于我是从错误的分支推进的。

$ git push heroku master

$ git push heroku heroku_branch:master

这特定于上面的情况,你从主分支中有一个单独的分支。