Skip to content

Instantly share code, notes, and snippets.

@stachibana
Last active May 19, 2020 01:54
Show Gist options
  • Save stachibana/faa02393d82af1a3fbf7e555f482d454 to your computer and use it in GitHub Desktop.
Save stachibana/faa02393d82af1a3fbf7e555f482d454 to your computer and use it in GitHub Desktop.
Ruby on Rails 2.7.1 + ngrok on Cloud9

AWSアカウント、IAMユーザー作成

こちらを参考に

https://remonote.jp/aws-cloud9-ruby-on-rails

AWS Cloud9の環境作成

Cloud9はオンライン上の開発環境です。

ブラウザ上でシェルとIDEを利用することが可能です。

https://console.aws.amazon.com/cloud9/home/product

こちらの「Create Environment」をクリックします。

値は全てデフォルトのままで、 Next Step、Create Environmentとクリックします。

git等のコマンドでダウンロードしたファイルが左サイドバーに表示され、「Welcome」タブを閉じるとテキストの編集が可能です。

Rubyのアップデート

Rubyのバージョンが古いのでTerminalで以下のコマンドを順次実行し、アップデートします。

git clone https://github.com/rbenv/rbenv.git ~/.rbenv

git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build

echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile

~/.rbenv/bin/rbenv init

echo 'eval "$(rbenv init -)"' >> ~/.bash_profile

source ~/.bash_profile

rbenv install 2.7.1

rbenv global 2.7.1

ngrokのインストール

npm i -g ngrok

SQLiteのアップデート

ActiveRecordがこけるので3.9にアップデートします。

wget https://www.sqlite.org/2019/sqlite-autoconf-3290000.tar.gz

tar xzvf sqlite-autoconf-3290000.tar.gz

cd sqlite-autoconf-3290000

./configure --prefix=/opt/sqlite/sqlite3

make

sudo make install

echo 'export PATH="/opt/sqlite/sqlite3/bin:$PATH"' >> ~/.bash_profile

echo 'export LD_LIBRARY_PATH="/opt/sqlite/sqlite3/lib"' >> ~/.bash_profile

source ~/.bash_profile

cd ~/environment/

環境の削除

https://console.aws.amazon.com/cloud9/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment