jimagic
jimagic

Reputation: 4065

CSS breaks in heroku

I am newbie in Heroku. When I run this rails application locally, its works fine and when I deployed to heroku its breaks. Please see the image. I pointed arrow inside that image.


Works fine locally here and its suppose to work this way. enter image description here


CSS breaks image here and not suppose to be like this. Only happens in Heroku server. enter image description here


I have multiple CSS files inside the rails application, about 9 of them.
I am using Rails 3.2 with Ruby 1.9.3

I have been trying to fix this issue and searched for this solution everywhere but no luck. It was working fine before, but I don't know how its happen?

Any help is appreciated, I will mark the answer as correct if it is solved.

thanks!

Update: when I do git push heroku, this is what i saw:

-----> Preparing app for Rails asset pipeline
       Running: rake assets:precompile
       DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /tmp/build_9a6529a8-57cd-4fb0-9cc0-39ebfcdb2c7a/Rakefile:7)
       DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /tmp/build_9a6529a8-57cd-4fb0-9cc0-39ebfcdb2c7a/Rakefile:7)
       DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /tmp/build_9a6529a8-57cd-4fb0-9cc0-39ebfcdb2c7a/Rakefile:7)
       DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /tmp/build_9a6529a8-57cd-4fb0-9cc0-39ebfcdb2c7a/Rakefile:7)
       Asset precompilation completed (105.95s)

Inside the application.css, I see

/*
*= require_self
*= require_tree .
*/

/* rest of file omitted */

Upvotes: 1

Views: 356

Answers (1)

Machine
Machine

Reputation: 472

It's probably related to the asset pipeline.

Make sure all your assets are required by application.css or added to

config.assets.precompile += ['admin.js', 'admin.css', 'swfObject.js']

in application.rb.

The assets compile in runtime locally but not in production.

EDIT: For active_admin to play nice don't include it in the application.css, i.e.: remove the

require_tree .

and require each file/directory separately.

Upvotes: 2

Related Questions