LoginSignup
1
2

More than 5 years have passed since last update.

heroku/ruby で bower install する hack

Last updated at Posted at 2013-04-11

nodejs アプリケーションならふつうに package.json の postinstall でいいのですが、 ruby アプリケーションだと package.json を実行してくれません。

しかし、 ruby buildpack は assets:precompile rake task があれば実行するので悪用します。

Rakefile
task "assets:precompile" do
  `(cd /tmp && curl -O https://heroku-buildpack-nodejs.s3.amazonaws.com/nodejs-0.8.19.tgz)`
  `(mkdir -p bin/nodejs && cd bin/nodejs && tar xzf /tmp/nodejs-0.8.19.tgz)`
  `(cd bin && ln -s nodejs/bin/node node)`
  `node bin/nodejs/bin/npm install`
end

rails の場合はすでに assets:precompile が定義されているのでなんとかしてください(別 task にして assets:precompile が依存するようにすればいいのかな?)。

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