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 5 years have passed since last update.

【Rails 備忘録】デプロイする時に定番で使うコマンド

Last updated at Posted at 2019-07-01

はじめに

備忘録です。

デプロイで使うコマンド

前提条件として、
AWS EC2環境/var/www/app/ 配下でgit cloneさせます。

git clone

言わずもがなgit cloneです。

git pull

言わずもがなgit pullです。

bundle install

bundle install --path=vendor/bundle --without development test

assets precompile

bundle exec rails assets:precompile RAILS_ENV=staging

migrate

bundle exec rails db:migrate RAILS_ENV=staging

rails server起動

bundle exec rails s -e staging -d

rails server停止

ps aux | grep rails (rails s -e staging -d のプロセスidを見つける)
kill プロセスid

rails コンソール

bundle exec rails c -e staging

ちなみに

上記はstaging環境でのコマンドとなります。
production環境の場合、stagingを**production**に変更すればOK。

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?