Skip to content

Instantly share code, notes, and snippets.

@ankane
Forked from nybblr/ rails-with-bower.md
Last active August 29, 2015 14:23
Show Gist options
  • Save ankane/fca8d6a3cf2eecf1c4e1 to your computer and use it in GitHub Desktop.
Save ankane/fca8d6a3cf2eecf1c4e1 to your computer and use it in GitHub Desktop.

Checkout the blog post for the whole story.

Setup Bower and install components:

npm install -g bower
bower install

Before deploying to Heroku, switch to the multi buildpack:

heroku config:add BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-multi.git

Then deploy as usual!

{
"directory": "vendor/assets/components"
}
https://github.com/heroku/heroku-buildpack-nodejs
https://github.com/heroku/heroku-buildpack-ruby
/vendor/assets/components
module MyApp
class Application < Rails::Application
# ...
config.assets.paths << Rails.root.join("vendor","assets","components")
end
end
{
"name": "my-app",
"dependencies": {
"jquery": "~2.1.0",
"jquery-ujs": "~1.0.1"
}
}
{
"name": "my-app",
"devDependencies": {
"bower": "latest"
},
"scripts": {
"postinstall": "./node_modules/bower/bin/bower install"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment