Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

This article is a Private article. Only a writer and users who know the URL can access it.
Please change open range to public in publish setting if you want to share this article with other users.

More than 3 years have passed since last update.

ruby & rails の 環境構築

Last updated at Posted at 2020-03-05

#OSバージョン
macOS Catalina(10.15.4)

rbenv install

brew install rbenv

#ruby-build install

brew install ruby-build

#zprofile に設定を追加

echo '' >> ~/.zprofile
echo '# rbenv' >> ~/.zprofile
echo 'export PATH="~/.rbenv/shims:/usr/local/bin:$PATH"' >> ~/.zprofile
echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.zprofile
source ~/.zprofile

#ruby install

# install 可能な version は rbenv install --list で確認
rbenv install #{rubyのversion}
rbenv rehash

# default のバージョンに指定する場合は以下を実施
rbenv gloabal #{rubyのversion}

#bundler install

gem install bundler

#rails install

gem install rails

# rails コマンドの確認をしたら下記のエラーが発生したため下記のコマンドにて解消させる
# Rails is not currently installed on this system. To get the latest version, simply type:
rbenv rehash

結果確認

$ rails -v
Rails 6.0.2.2
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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?