Rails7のインストール

どうも、今回はRails7がリリースされたと言うことで、そちらをインストールしていきたいと思います。

結論

結論はRubyの3系をインストールして、gem install rails をしてあげればOKです。

実際のターミナル

実際に使ったコマンドを載せておくので、確認してみてください。

$ rbenv install -l
2.6.9
2.7.5
3.0.3
jruby-9.3.2.0
mruby-3.0.0
rbx-5.0
truffleruby-21.3.0
truffleruby+graalvm-21.3.0

Only latest stable releases for each Ruby implementation are shown.
Use 'rbenv install --list-all / -L' to show all local versions.

$ rbenv install 3.0.3
Downloading openssl-1.1.1l.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/0b7a3e5e59c34827fe0c3a74b7ec8baef302b98fa80088d7f9153aa16fa76bd1
Installing openssl-1.1.1l...
Installed openssl-1.1.1l to /Users/shinji/.rbenv/versions/3.0.3

Downloading ruby-3.0.3.tar.gz...
-> https://cache.ruby-lang.org/pub/ruby/3.0/ruby-3.0.3.tar.gz
Installing ruby-3.0.3...
ruby-build: using readline from homebrew
Installed ruby-3.0.3 to /Users/shinji/.rbenv/versions/3.0.3

$ rbenv rehash

$ ruby -v
ruby 3.0.1p64 (2021-04-05 revision 0fb782ee38) [x86_64-darwin20]

$ rbenv versions
  system
  3.0.0
* 3.0.1 (set by /Users/shinji/.rbenv/version)
  3.0.3

$ rbenv global 3.0.3

$ ruby -v
ruby 3.0.3p157 (2021-11-24 revision 3fb7d2cadc) [x86_64-darwin21]

$ gem install rails
Fetching thor-1.1.0.gem
Fetching method_source-1.0.0.gem
Fetching concurrent-ruby-1.1.9.gem
Fetching tzinfo-2.0.4.gem
Fetching i18n-1.8.11.gem
Fetching zeitwerk-2.5.1.gem
Fetching activesupport-7.0.0.gem
Fetching nokogiri-1.12.5-x86_64-darwin.gem
Fetching rack-2.2.3.gem
Fetching crass-1.0.6.gem
Fetching loofah-2.13.0.gem
Fetching rails-html-sanitizer-1.4.2.gem
Fetching rails-dom-testing-2.0.3.gem
Fetching rack-test-1.1.0.gem
Fetching erubi-1.10.0.gem
Fetching builder-3.2.4.gem
Fetching actionview-7.0.0.gem
Fetching actionpack-7.0.0.gem
Fetching railties-7.0.0.gem
Fetching mini_mime-1.1.2.gem
Fetching marcel-1.0.2.gem
Fetching activemodel-7.0.0.gem
Fetching activerecord-7.0.0.gem
Fetching globalid-1.0.0.gem
Fetching activejob-7.0.0.gem
Fetching activestorage-7.0.0.gem
Fetching actiontext-7.0.0.gem
Fetching mail-2.7.1.gem
Fetching actionmailer-7.0.0.gem
Fetching actionmailbox-7.0.0.gem
Fetching websocket-extensions-0.1.5.gem
Fetching websocket-driver-0.7.5.gem
Fetching rails-7.0.0.gem
Fetching nio4r-2.5.8.gem
Fetching actioncable-7.0.0.gem
Successfully installed zeitwerk-2.5.1
Successfully installed thor-1.1.0
Successfully installed method_source-1.0.0
Successfully installed concurrent-ruby-1.1.9
Successfully installed tzinfo-2.0.4
Successfully installed i18n-1.8.11
Successfully installed activesupport-7.0.0
Successfully installed nokogiri-1.12.5-x86_64-darwin
Successfully installed crass-1.0.6
Successfully installed loofah-2.13.0
Successfully installed rails-html-sanitizer-1.4.2
Successfully installed rails-dom-testing-2.0.3
Successfully installed rack-2.2.3
Successfully installed rack-test-1.1.0
Successfully installed erubi-1.10.0
Successfully installed builder-3.2.4
Successfully installed actionview-7.0.0
Successfully installed actionpack-7.0.0
Successfully installed railties-7.0.0
Successfully installed mini_mime-1.1.2
Successfully installed marcel-1.0.2
Successfully installed activemodel-7.0.0
Successfully installed activerecord-7.0.0
Successfully installed globalid-1.0.0
Successfully installed activejob-7.0.0
Successfully installed activestorage-7.0.0
Successfully installed actiontext-7.0.0
Successfully installed mail-2.7.1
Successfully installed actionmailer-7.0.0
Successfully installed actionmailbox-7.0.0
Successfully installed websocket-extensions-0.1.5
Building native extensions. This could take a while...
Successfully installed websocket-driver-0.7.5
Building native extensions. This could take a while...
Successfully installed nio4r-2.5.8
Successfully installed actioncable-7.0.0
Successfully installed rails-7.0.0
35 gems installed
shinji@ShinjinoMacBook-Pro: ~ 
$ rails -v
Rails 7.0.0


Leave a Reply

Your email address will not be published.

CAPTCHA