Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work with rails 3.1 on Heroku cedar stack #16

Closed
davidkariuki opened this issue Sep 18, 2011 · 23 comments
Closed

Doesn't work with rails 3.1 on Heroku cedar stack #16

davidkariuki opened this issue Sep 18, 2011 · 23 comments

Comments

@davidkariuki
Copy link

See attached stack trace. The gem is installed on heroku but for some reason @import can't find bourbon. No problems in development.

2011-09-18T21:34:09+00:00 app[web.1]: Processing by PagesController#home as HTML
2011-09-18T21:34:09+00:00 app[web.1]: Rendered pages/home.html.haml within layouts/application (5.5ms)
2011-09-18T21:34:10+00:00 app[web.1]: Completed 500 Internal Server Error in 394ms
2011-09-18T21:34:10+00:00 app[web.1]:
2011-09-18T21:34:10+00:00 app[web.1]: ActionView::Template::Error (File to import not found or unreadable: bourbon.
2011-09-18T21:34:10+00:00 app[web.1]: Load path: /app
2011-09-18T21:34:10+00:00 app[web.1]: (in /app/app/assets/stylesheets/application.css.sass)):

@mjankowski
Copy link
Contributor

Hi David, what gems do you have installed? What does your production.rb config look like re: the asset pipeline?

Can you paste the relevant part of your application.css.sass ?

@mjankowski
Copy link
Contributor

Can you also confirm how you are including the stylesheets from your layout?

@nhocki
Copy link

nhocki commented Sep 26, 2011

I've had that same problem on production. I've solved it by removing the 'assets' group from the Gemfile (weird).

Maybe that'll help.

@mjankowski
Copy link
Contributor

Things maybe relevant to this, curious to hear what you guys are doing...

  • In your config/application.rb, which Bundler.require line are you using?
  • Do you have the sass-rails gem installed, or just sass gem?
  • How do you include your stylesheets from the layout?
  • Are you doing any "precompile" of assets or relying totally on heroku to do this?

@czj
Copy link

czj commented Oct 7, 2011

I've had the same problem for several days and nothing seems to fix it. All versions of Bourbon give me the same problem : works for assets pre-compilation but I get an error message when running production on Heroku.

I have tried gem "bourbon" at the root of the Gemfile or in the "assets" group. I have also tried @import "bourbon" in the root sass file or in each of the imported sass files.

I am not using SCSS but SASS syntax, don't know if this might be an issue (I guess not).

@mjankowski
Copy link
Contributor

Additional question to my previous batch -- make sure you've run rake rails:update to get the asset pipeline related changes to run in your production/staging/whatever environments on heroku.

@czj
Copy link

czj commented Oct 7, 2011

I forgot to say it is a brand new Rails 3.1 application, made from scratch for/with the assets pipeline / sass / bourbon or compass in mind.

@nickmjones
Copy link

I had the same issue. I did a 'bundle update' and the deployment seemed to work the second time. My config is totally plain vanilla, nearly bone-stock Rails 3.1. Having an "assets" group didn't seem to make a difference.

@mjankowski
Copy link
Contributor

For anyone still having this issue - please provide us with the info that my 9/26 and 10/7 comments ask for so we can attempt to debug.

@chrism
Copy link

chrism commented Nov 6, 2011

Same problem:

1

Bundler.require *Rails.groups(:assets => %w(development test))

2

sass-rails installed

3

like this

@import "bourbon";
@import 'flutie';
@import 'scaffolds';

using application.css.scss

4

would like to use heroku to precompile during deployment

many thanks for any help!

@nm
Copy link

nm commented Nov 15, 2011

I also got the same problem:

  1. Bundler.require *Rails.groups(:assets => %w(development test))
  2. sass-rails installed
  3. @import "bourbon"; (application.css.scss)
  4. When I precompile the assets locally it works, but I'd like to rely totally on heroku

Thx in advance!

@czj
Copy link

czj commented Nov 15, 2011

One way to fix the problem might be to have a "main" css file without anything specific and not forgetting to include it in your application.rb :

# We need admin javascript & css assets to be precompiled too
config.assets.precompile += ['login.css', 'admin.css', 'admin.js']

Then your admin.css should be simple :

/*
*= require_tree ./admin
*/

It worked for me.

@seivan
Copy link

seivan commented Jan 24, 2012

I still got this issue.
Rails 3.2
Bourbon is outside of the asset group. Works fine in dev, not on Heroku.
ctionView::Template::Error (File to import not found or unreadable: bourbon.

*= require bootstrap/bootstrap
*= require_self

*/

@import "bourbon";

@seivan
Copy link

seivan commented Jan 30, 2012

Any progress on this?

@erikostling
Copy link

I'm also getting the same problem as @seivan when deploying a Rails 3.2.1 app to Heroku with bourbon 1.3.6.

(ps. Seems to be Active admin causing the problem though… ds)

(ps 2. This solved my problem: https://gist.github.com/1197686 ds.)

@rkleine
Copy link

rkleine commented Feb 9, 2012

https://gist.github.com/1197686 also solve for me.

@gdakram
Copy link

gdakram commented Feb 16, 2012

+1 for @rkleine15 and @erikostling tip.

@dtt101
Copy link

dtt101 commented Mar 18, 2012

Just a note - this isn't anything to do with Bourbon I don't think, rather the case that your app is trying to connect to the database when assets:precompile is run on heroku. There is an article here explaining the issue: http://devcenter.heroku.com/articles/rails3x-asset-pipeline-cedar

The solution for me was to add the following line to config/application.rb

config.assets.initialize_on_precompile = false

I then followed the Bourbon installation instructions for Rails 3.1.x as documented here: https://github.com/thoughtbot/bourbon

I am running Rails 3.2.1

@gmassanek
Copy link

@ugisozols gist fixed this for me, thanks! https://gist.github.com/1197686.
Note: I was having this issue on my own VPS, not Heroku. Using Rails 3.1.1

@gonzofy
Copy link

gonzofy commented Sep 4, 2012

dtt101: thanks for that. Just ran into the same thing and it worked for me.

@goodtimeaj
Copy link

config.assets.initialize_on_precompile = false works for me. Thanks.

@mikekellyio
Copy link

@dtt101: excellent! that's the trick.

@darthniwo
Copy link

https://gist.github.com/1197686 is working just fine, I'm running rails 3.2.1, also tested on heroku

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests