LoginSignup
0
1

More than 3 years have passed since last update.

【忘備録】Rubyをやってみて何度も調べたコマンド一覧

Last updated at Posted at 2020-10-28

はじめに

Rubyを半年程さわってみて、調べる頻度が多かったコマンドをここでまとめてます。
初学者兼初投稿なのでコメントやLGTMなどでフィードバック頂けると励みになります。よろしくお願いします。

Ruby関連

rubyのバージョンを確認する
$ ruby -v

railsのバージョンを確認する
$ rails -v

credentials.yml.encのファイルを開く
$ EDITOR='code --wait' rails credentials:edit
(※vscodeでファイルを開くにはshellをインストールしてcodeコマンドを使えるようにする必要あり)

unicorn関連

起動状態を確認する
$ ps auxwww | grep unicorn

プロセスを終了する
$ kill -9 ○○○○○○

すべてのログを確認する ($ cd /var/www/app/log にて)
$ less unicorn.staderr.log

直近10件のログを確認する ($ cd /var/www/app/log にて)
$ tail unicorn.staderr.log

nginx関連

再起動する
$ sudo service nginx restart

すべてのログを確認する (本番環境のホームディレクトリにて)
$ sudo less /var/log/nginx/error.log

MySQL関連

起動状況を確認する
$ sudo service mysqld status

起動する
$ sudo service mysqld start

Capistrano関連

デプロイ実行
$ bundle exec cap production deploy

1つ前の状態にロールバック
$ bundle exec cap production deploy:rollback

本番環境まわりのコマンドばかりになってしまいましたが、過不足があれば随時更新していきます。

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