0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

heroku run rails db:migrateでエラーが出た話

Last updated at Posted at 2020-04-29

Railsチュートリアルの第6章「6.4最後に」の節でエラーが出たので勉強として書き記しておくことにしました。

###やりたいこと
本番環境でUserモデルを使うために、heroku runコマンドを使ってHeroku上にマイグレーションを走らせたい。

###エラー直前にやったこと

$ heroku run rails db:migrate

###エラー内容

bash: heroku: command not found

###エラー後にしたこと

$ sudo yum -y update
$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash
$ export NVM_DIR=”/home/ec2-user/.nvm”
$ [ -s “$NVM_DIR/nvm.sh” ] && \. “$NVM_DIR/nvm.sh”
$ nvm install node --reinstall-packages-from=node
$ npm install -g cli-engine-command@8.0.0
$ npm install -g heroku-cli

###Special Thanks
Cloud9でHerokuが使えない時の対処法
[AWS Cloud9でherokuコマンドがnot foundになった時の対処法]
(https://qiita.com/yumelog/items/c1ece8b84302138c7834)

無事できました。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?