LoginSignup
17
17

More than 5 years have passed since last update.

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

Last updated at Posted at 2014-11-30

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"
   }
 }
17
17
3

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
17
17