My blueprint css works on my local machine, but when I push to heroku I get an error.
I have blueprint stored in my app/assets/stylesheets folder
and he
Try setting your:
config.assets.precompile += %w( blueprint/screen.css blueprint/print.css )
in
config/environments/production.rb
I'm sure someone with more experience than me can tell us why all css files aren't pre-compiled as standard. I'm only just starting out too!
Here's at least one discussion: Rails 3.1 asset pipeline - missing files from public/assets - why isn't this the default?
One way to fix this is to precompile the assets by running rake assets:precompile
. You have to include a javascript runtime for this by adding
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'therubyracer'
gem 'sass-rails', " ~> 3.1.0"
gem 'coffee-rails', "~> 3.1.0"a
gem 'uglifier'
end
to the Gemfile
and run bundle install
.
I just had the same problem. I solved it by setting config.assets.compile = true
in config/environments/production.rb
EDIT: This works fine while developing, but has a performance penalty as compilation is performed in run-time. See the answer below for a better solution
I tried to run rake assets:precompile and couldn't get it to work. I have the assets group in my Gemfile. I read somewhere that I should make sure to precompile the production env:
RAILS_ENV=production bundle exec rake assets:precompile
That didn't help either. I ended up doing the config.assets.compile = true, which worked fine, but I would love to get the real solution to work.
I never get the -----> Preparing Rails asset pipeline
when pushing to heroku that they say one should get.