17
Help us understand the problem. What are the problem?

More than 5 years have passed since last update.

posted at

updated at

Organization

railsでもbowerでasset管理しつつherokuにもdeployする方法

Bowerを導入します。

node.js

$ brew upgrade node

bower-rails

$ vim Gemfile
 gem 'jbuilder', '~> 2.0'
 gem 'enumerize'
 gem 'factory_girl_rails'
+gem 'bower-rails'

 group :development, :test do
   gem 'spring'
$ rails g bower_rails:initialize

assetを追加

$ vim Bowerfile

なんか、いろいろ

asset 'reset-css'
asset 'jquery-ujs'
asset 'jquery-ui'
asset 'components-font-awesome'
$ rake bower:install

herokuにあげたい場合

$ heroku config:set BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-multi.git
$ vim .buildpacks
https://github.com/heroku/heroku-buildpack-nodejs
https://github.com/heroku/heroku-buildpack-ruby

heroku buttonの設置例

$ vim app.json
   "repository": "https://github.com/ppworks/furikaeri",
   "scripts": {
     "postdeploy": "bundle exec rake db:migrate && bundle exec rake db:seed"
+  },
+  "env": {
+    "BUILDPACK_URL": "https://github.com/heroku/heroku-buildpack-multi.git"
   }
 }
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Sign upLogin
17
Help us understand the problem. What are the problem?