LoginSignup
0
0

More than 1 year has passed since last update.

Ruby on Railsのcloud9環境の設定手順

Posted at

Rails Tutorialより

Rubyドキュメントをスキップする設定を.gemrcファイルに追加するコマンド
echo "gem: --no-document" >> ~/.gemrc
Rails gemのインストール(今回は6.1.4を使用)

Railsバージョンアップ情報

gem install rails -v バージョン番号
bundler gemのインストール(今回は2.2.17を使用)
gem install bundler -v バージョン番号
Yarnのインストール、セットアップ
source <(curl -sL https://cdn.learnenough.com/resize)
source <(curl -sL https://cdn.learnenough.com/yarn_install)
ローカルWebサーバーへの接続の許可

config/environments/development.rb

Rails.application.configure do
  .
  .
  .
  # Cloud9 への接続を許可する
  config.hosts.clear
end
Gemfileの設定+bundleの実行

参考記事:Gemfileにバージョンを指定したり、しなかったり。Gemfileについて

# production環境でしか使わないgemはインストールしないよう設定
bundle _2.2.17_ config set --local without 'production'  

bundle _2.2.17_ install
webpacherのインストール
rails webpacker:install
Gitの操作

Gitの設定

git config --global user.name "自分の名前"
git config --global user.email your.email@example.com

# パスワードの再入力をしなくていい時間を設定
git config --global credential.helper "cache --timeout=86400" 

# エイリアスメソッドを設定
git config --global alias.<エイリアス名> コマンド

Githubへの初めてのプッシュ

git init
git add -A
git commmit -m "<コメント>"
git remote add origin <uri>
git push -u origin master
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