4
votes

I'm messing around with a rails 3.1 app and deploying to Heroku Cedar.

When pushing an app, Heroku skips over the precompile step without throwing an error:

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

The last time I pushed to Heroku (maybe a month ago) it had no problem precompiling assets.

gem 'rails', '3.1.1.rc2', :git => 'git://github.com/rails/rails.git', :branch => '3-1-stable'

UPDATE:

I was able to get Heroku to precompile by removing the following from 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

and replacing with:

# 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)
2
That seemed to work for me. The push to heroku still said there were errors, but the page loads correctly.John Goodman

2 Answers

0
votes

I know this may sound conceiting, but did you make sure you create the Heroku app with -stack cedar?

0
votes

You could also check to see that sprockets is enabled as I did here when I was having the same problem.