我瞎搞與導軌3.1應用程序,並部署到Heroku的雪松。爲什麼逃課的Heroku對Rails 3.1的應用程序預編譯步驟?
當按下一個應用程序,Heroku的跳過預編譯的步驟,無需拋出一個錯誤:
Your bundle is complete! It was installed into ./vendor/bundle
Cleaning up the bundler cache.
-----> Writing config/database.yml to read from DATABASE_URL
-----> Rails plugin injection
Injecting rails_log_stdout
Injecting rails3_serve_static_assets
-----> Discovering process types
Procfile declares types -> (none)
Default types for Ruby/Rails -> console, rake, web, worker
-----> Compiled slug size is 16.2MB
-----> Launching... done, v35
我最後一次被推到Heroku的(也許一個月前),它有沒有問題預編譯的資產。
gem 'rails', '3.1.1.rc2', :git => 'git://github.com/rails/rails.git', :branch => '3-1-stable'
UPDATE:
我能得到的Heroku通過從application.rb中以下預編譯:
if defined?(Bundler)
# If you precompile assets before deploying to production, use this line
Bundler.require *Rails.groups(:assets => %w(development test))
# If you want your assets lazily compiled in production, use this line
# Bundler.require(:default, :assets, Rails.env)
end
,並替換:
# If you have a Gemfile, require the gems listed there, including any gems
# you've limited to :test, :development, or :production.
Bundler.require *Rails.groups(:assets) if defined?(Bundler)
這似乎爲我工作。推向heroku仍然說有錯誤,但頁面加載正確。 –