豚吐露@wiki

herokuでyarnを使う方法

最終更新:

Bot(ページ名リンク)

- view
管理者のみ編集可

herokuでyarnを使う方法

  • local側
rails 5.1.3
node v6.12.0
yarn 1.3.2

  • heroku側
rails 5.1.3
node v8.9.1
yarn 1.3.2


webpackありきのばっかりで、assets使う方法がなかなか見つからなかったのでメモ。


heroku上の実行環境は準備できてるとして、新たにyarn環境を構築したものをdeployしたら
remote: Yarn executable was not detected in the system.
remote: Download Yarn at https://yarnpkg.com/en/docs/install
こんなmessageが表示されてどうにもdeployできなくて結構はまった。
netで探すとpackage.jsonにengines項目書けってのばっかり見つかる。
が、結局のところbuildpacksの設定が全て。こんなになってた。

$ heroku buildpacks
=== RAILS-APP Buildpack URLs
1. heroku/ruby
2. heroku/nodejs

何が問題かと言うと、『heroku/ruby』が『heroku/nodejs』の上にあること。


これを正しい順番に直す。
$ heroku buildpacks:clear
Buildpacks cleared. Next release on judgement-recorder will detect buildpack normally.
$ heroku buildpacks:add heroku/nodejs
Buildpack added. Next release on RAILS-APP will use heroku/nodejs.
Run git push heroku master to create a new release using this buildpack.
$ heroku buildpacks:add heroku/ruby
Buildpack added. Next release on RAILS-APP will use:
1. heroku/nodejs
2. heroku/ruby
Run git push heroku master to create a new release using these buildpacks.
これで『heroku/nodejs』が『heroku/ruby』より上になった。
この状態で、
$ git push heroku master
とかやってやると、
remote: Verifying deploy... done.
deployできました。


結局、engines設定したら...で解決するのってどういう環境の人なんだろ?



更新日: 2017年11月24日 (金) 22時19分59秒

名前:
コメント:

すべてのコメントを見る
記事メニュー
ウィキ募集バナー