Skip to content

Instantly share code, notes, and snippets.

@ankane
Forked from nybblr/ rails-with-bower.md
Last active August 29, 2015 14:23
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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