LoginSignup
7
7

More than 5 years have passed since last update.

Railsでパッケージ管理にBowerを使用する(Heroku編)

Posted at

gitの管理下にbower_components以下を入れないので、Heroku上でbower installする必要がある。

heroku-buildpack-multi
https://github.com/ddollar/heroku-buildpack-multi

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

Rails.rootに.buildpacksを作って

https://github.com/heroku/heroku-buildpack-nodejs.git
https://github.com/heroku/heroku-buildpack-ruby.git

タグも追加した方が多分無難

https://github.com/heroku/heroku-buildpack-nodejs.git#v60
https://github.com/heroku/heroku-buildpack-ruby.git#v128

同じくRails.rootにpackage.jsonを作ってnpmのインストール設定をする。

{
  "name": "App",
  "version": "0.0.0",
  "homepage": "xxx",
  "authors": [
    "xxx"
  ],
  "version": "0.0.0",
  "scripts": {
    "postinstall": "bower cache clean && bower install"
  },
  "license": "MIT",
  "dependencies": {
    "bower": "^1.3.12"
  },
  "engines": {
    "node": "0.10.x"
  }
}
git add . && git commit -m "heroku multi-buildpack"

git push heroku master

travis-ciの設定はまた今度…

7
7
0

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
7
7