4

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)
1
  • That seemed to work for me. The push to heroku still said there were errors, but the page loads correctly. Feb 1, 2012 at 19:20

2 Answers 2

0

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

1
  • heroku stack aspen-mri-1.8.6 bamboo-mri-1.9.2 bamboo-ree-1.8.7 * cedar (beta) Oct 2, 2011 at 19:55
0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.