Skip to content

Instantly share code, notes, and snippets.

@cocolote
Last active August 29, 2015 14:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cocolote/18755fa7ed3a74280ea7 to your computer and use it in GitHub Desktop.
Save cocolote/18755fa7ed3a74280ea7 to your computer and use it in GitHub Desktop.
Rails: How to fix the assets pipe to work with Heroku

The annoying Assets Pipe problem with Heroku and Rails

1_ in config/environments/production.rb

Set config.assets.compile = false to config.assets.compile = true

2_ in config/application.rb

Add the line config.assets.compile = true

module Main
  class Application < Rails::Application
    .
    .
    config.assets.compile = true
  end
end

3_ add this two gems to your Gemfile

group :production do
 gem "rails_12factor"
 gem "rails_serve_static_assets"
end

4_ install the new gems

$ Bundle
$ git add -A
$ git commit -m"setup assets pipe for heroku"
$ git push origin master
$ git push heroku master

That's it, you are ready to go!.

Good coding

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment