blueprint css rails 3.1 help

筅森魡賤 提交于 2019-11-28 20:24:45

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

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.

Gary Barker

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?

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!