Ruby on Railsのインストール
【開発環境】
OS:Win11(64ビット)
Ruby 3.1.2
■Ruby on Railsとは
Railsとは、プログラミング言語「Ruby」で書かれたWebアプリケーションフレームワークです。Railsは、あらゆる開発者がWebアプリケーション開発で必要となる作業やリソースを事前に想定することで、Webアプリケーションをより手軽に開発できるように設計されています。他の多くのWebアプリケーションフレームワークと比較して、アプリケーションを開発する際のコード量がより少なくて済むにもかかわらず、より多くの機能を実現できます。
■Ruby on railsのインストール方法
Rubyがインストールした状態でこコマンドプロンプトに、以下のコマンドを入力する
・コマンド
Microsoft Windows [Version 10.0.22000.856]
(c) Microsoft Corporation. All rights reserved.
C:\Users\Owner>gem install rails
Fetching concurrent-ruby-1.1.10.gem
Fetching activesupport-7.0.3.1.gem
Fetching tzinfo-2.0.5.gem
Fetching thor-1.2.1.gem
Fetching i18n-1.12.0.gem
Fetching method_source-1.0.0.gem
Fetching zeitwerk-2.6.0.gem
Fetching nokogiri-1.13.8-x64-mingw-ucrt.gem
Fetching crass-1.0.6.gem
Fetching loofah-2.18.0.gem
Fetching rails-html-sanitizer-1.4.3.gem
Fetching rails-dom-testing-2.0.3.gem
Fetching rack-2.2.4.gem
Fetching rack-test-2.0.2.gem
Fetching erubi-1.11.0.gem
Fetching builder-3.2.4.gem
Fetching actionview-7.0.3.1.gem
Fetching actionpack-7.0.3.1.gem
Fetching railties-7.0.3.1.gem
Fetching mini_mime-1.1.2.gem
Fetching marcel-1.0.2.gem
Fetching activemodel-7.0.3.1.gem
Fetching activerecord-7.0.3.1.gem
Fetching globalid-1.0.0.gem
Fetching activejob-7.0.3.1.gem
Fetching activestorage-7.0.3.1.gem
Fetching actiontext-7.0.3.1.gem
Fetching mail-2.7.1.gem
Fetching actionmailer-7.0.3.1.gem
Fetching actionmailbox-7.0.3.1.gem
Fetching websocket-extensions-0.1.5.gem
Fetching websocket-driver-0.7.5.gem
Fetching rails-7.0.3.1.gem
Fetching nio4r-2.5.8.gem
Fetching actioncable-7.0.3.1.gem
Successfully installed zeitwerk-2.6.0
Successfully installed thor-1.2.1
Successfully installed method_source-1.0.0
Successfully installed concurrent-ruby-1.1.10
Successfully installed tzinfo-2.0.5
Successfully installed i18n-1.12.0
Successfully installed activesupport-7.0.3.1
Successfully installed nokogiri-1.13.8-x64-mingw-ucrt
Successfully installed crass-1.0.6
Successfully installed loofah-2.18.0
Successfully installed rails-html-sanitizer-1.4.3
Successfully installed rails-dom-testing-2.0.3
Successfully installed rack-2.2.4
Successfully installed rack-test-2.0.2
Successfully installed erubi-1.11.0
Successfully installed builder-3.2.4
Successfully installed actionview-7.0.3.1
Successfully installed actionpack-7.0.3.1
Successfully installed railties-7.0.3.1
Successfully installed mini_mime-1.1.2
Successfully installed marcel-1.0.2
Successfully installed activemodel-7.0.3.1
Successfully installed activerecord-7.0.3.1
Successfully installed globalid-1.0.0
Successfully installed activejob-7.0.3.1
Successfully installed activestorage-7.0.3.1
Successfully installed actiontext-7.0.3.1
Successfully installed mail-2.7.1
Successfully installed actionmailer-7.0.3.1
Successfully installed actionmailbox-7.0.3.1
Successfully installed websocket-extensions-0.1.5
Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions. This could take a while...
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
current directory: D:/pg/Ruby31-x64/lib/ruby/gems/3.1.0/gems/websocket-driver-0.7.5/ext/websocket-driver
D:/\p\g/Ruby31-x64/bin/ruby.exe -I D:/\p\g/Ruby31-x64/lib/ruby/3.1.0 -r ./siteconf20220822-29748-kuma82.rb extconf.rb
creating Makefile
current directory: D:/pg/Ruby31-x64/lib/ruby/gems/3.1.0/gems/websocket-driver-0.7.5/ext/websocket-driver
make DESTDIR\= clean
current directory: D:/pg/Ruby31-x64/lib/ruby/gems/3.1.0/gems/websocket-driver-0.7.5/ext/websocket-driver
make DESTDIR\=
generating websocket_mask-x64-mingw-ucrt.def
compiling websocket_mask.c
linking shared-object websocket_mask.so
D:/����/Ruby31-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find D:/����/Ruby31-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../lib/dllcrt2.o: Illegal byte sequence
D:/����/Ruby31-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find D:/����/Ruby31-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/crtbegin.o: Illegal byte sequence
D:/����/Ruby31-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lx64-ucrt-ruby310: No such file or directory
D:/����/Ruby31-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lshell32: No such file or directory
D:/����/Ruby31-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lws2_32: No such file or directory
D:/����/Ruby31-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -liphlpapi: No such file or directory
D:/����/Ruby31-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -limagehlp: No such file or directory
D:/����/Ruby31-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lshlwapi: No such file or directory
D:/����/Ruby31-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lbcrypt: No such file or directory
D:/����/Ruby31-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lssp_nonshared: No such file or directory
D:/����/Ruby31-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lssp: No such file or directory
D:/����/Ruby31-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lmingw32: No such file or directory
D:/����/Ruby31-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lgcc_s: No such file or directory
D:/����/Ruby31-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lgcc: No such file or directory
D:/����/Ruby31-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lmoldname: No such file or directory
D:/����/Ruby31-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lmingwex: No such file or directory
D:/����/Ruby31-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lmsvcrt: No such file or directory
D:/����/Ruby31-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lkernel32: No such file or directory
D:/����/Ruby31-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lpthread: No such file or directory
D:/����/Ruby31-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -ladvapi32: No such file or directory
D:/����/Ruby31-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lshell32: No such file or directory
D:/����/Ruby31-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -luser32: No such file or directory
D:/����/Ruby31-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lkernel32: No such file or directory
D:/����/Ruby31-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lmingw32: No such file or directory
D:/����/Ruby31-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lgcc_s: No such file or directory
D:/����/Ruby31-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lgcc: No such file or directory
D:/����/Ruby31-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lmoldname: No such file or directory
D:/����/Ruby31-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lmingwex: No such file or directory
D:/����/Ruby31-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lmsvcrt: No such file or directory
D:/����/Ruby31-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lkernel32: No such file or directory
D:/����/Ruby31-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find D:/����/Ruby31-x64/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/crtend.o: Illegal byte sequence
collect2.exe: error: ld returned 1 exit status
make: *** [Makefile:263: websocket_mask.so] エラー 1
make failed, exit code 2
Gem files will remain installed in D:/pg/Ruby31-x64/lib/ruby/gems/3.1.0/gems/websocket-driver-0.7.5 for inspection.
Results logged to D:/pg/Ruby31-x64/lib/ruby/gems/3.1.0/extensions/x64-mingw-ucrt/3.1.0/websocket-driver-0.7.5/gem_make.out
C:\Users\Owner>rails -v
Rails 7.0.3.1
以上