Open kieranklaassen opened 13 years ago
Same error. Is it needed to do something special? Just run 'rails server' and I got this:
File to import not found or unreadable: html5-boilerplate.
Load path: Sass::Rails::Importer([MY_PROJECT]...app/assets/stylesheets/style.scss)
(in [MY_PROJECT].../app/assets/stylesheets/style.scss)
Same error here, can't import compass or susy. Works fine in development.
Using latest sass-rails commit on 3-1-stable (which fixed some rails 3.1.1rc1 issues).
Just echoing this problem. Anyone find a solution yet?
i got it working know but don't know why yet :-), keep you posted
kieran: bundle update
? :)
maybe thats it yeah :-D, and i switched from the rails 3-1 stable branch on github to the gem again
I just started running into this problem too. However, it only happens when I run rake assets:precompile
and not when I'm just running my local server in dev mode.
Does this work locally: RAILS_ENV=production bundle exec rake assets:precompile
?
What I do now is running the asset precomile locally, checking the generated files out in git and pushing it to heroku. This way where is no need for server side assets:precompile.
Check this out if you haven't already: http://devcenter.heroku.com/articles/rails31_heroku_cedar#the_asset_pipeline
If you're having trouble when switching from development to production mode, try explicitly setting your sass load_paths:
require 'rails/all'
require "sass-rails" # add this here
module AppName
class Application < Rails::Application
# add these three lines:
config.sass.load_paths ||= []
config.sass.load_paths << "#{Rails.root}/app/assets/stylesheets"
config.sass.load_paths << "#{Gem.loaded_specs['compass'].full_gem_path}/frameworks/compass/stylesheets"
(change the last line accordingly - I was having issues doing @import "compass/etc")
I don't know what was causing it to break, but doing this worked for me.
Details:
If this solved your problem, let us know!
@anthonylebrun So it turns out that downgrading my version of compass by a point release fixed the problem. Thanks for the help though!
@kieranklaassen That hadn't been working locally, no. I'm also not using Heroku. By locking compass at revision 7147147e2412
, the problem was resolved. At least I was able to fix it!
I fixed the problem by commenting out config.assets.initialize_on_precompile = false
in application.rb
- it was there because devise recommended it, but so far it seems to work fine without it.
seems like I still run into this problem regardless of config.assets.initialize_on_precompile and gem 'compass', git: "https://github.com/chriseppstein/compass.git", ref: '7147147e2412'
@anthonylebrun Your comment fixed it for me. Thanks!
@jpadvo great! This one gave me a headache so I'm glad to it was useful to someone else!
@anthonylebrun your fix also worked here. now we just need to make it work out of the box.
@anthonylebrun your fix also worked for me. But I had to add an additional path for html5-boilerplate:
config.sass.load_paths << "#{Gem.loaded_specs['html5-boilerplate'].full_gem_path}/stylesheets"
Thanks!
@anthonylebrun It worked. This was so useful. Once again I have no idea why this works. Asset pipeline is so whiny and buggy sometimes. Thanks for the help!
@anthonylebrun +1, your hacks worked for me. Thanks!
All I need was the following line in environment.rb: config.sass.load_paths << "#{Gem.loaded_specs['compass'].full_gem_path}/frameworks/compass/stylesheets"
@anthonylebrun - Thanks for solution. It worked.
Definitely would like other solution which doesn't require explicitly setting of sass load_paths
@anthonylebrun : thanks !!! For me that was compass-h5bp. All I needed was to add this into application.rb: config.sass.load_paths ||= [] config.sass.load_paths << "#{Gem.loaded_specs['compass-h5bp'].full_gem_path}/stylesheets"
@Berlimioz 2 years later and this fix is still helping people. If only this was a stackoverflow answer ;)
For rails 4 I created a sass.rb initializer with this line of code:
Sass.load_paths << "#{Gem.loaded_specs['compass-h5bp'].full_gem_path}/stylesheets"
Another year later... we are still running into this issue
I keep getting this error while precompiling the assets in my Rails 3.1.0 app on deployment to my Heroku server.
config/compass.rb
app/assets/stylesheets/application.css.scss
Gemfile