D:\RubyFileという自分で作ったファイル上で、[gem install rails]というコマンドを実行すると、
current directory: C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/nio4r-1.2.1/ext/nio4r C:/Ruby23-x64/bin/ruby.exe -r ./siteconf20161222-5940-frnuel.rb extconf.rb checking for unistd.h... *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options. Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=C:/Ruby23-x64/bin/$(RUBY_BASE_NAME) C:/Ruby23-x64/lib/ruby/2.3.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError) You have to install development tools first. from C:/Ruby23-x64/lib/ruby/2.3.0/mkmf.rb:587:in `try_cpp' from C:/Ruby23-x64/lib/ruby/2.3.0/mkmf.rb:1091:in `block in have_header' from C:/Ruby23-x64/lib/ruby/2.3.0/mkmf.rb:942:in `block in checking_for' from C:/Ruby23-x64/lib/ruby/2.3.0/mkmf.rb:350:in `block (2 levels) in postpone' from C:/Ruby23-x64/lib/ruby/2.3.0/mkmf.rb:320:in `open' from C:/Ruby23-x64/lib/ruby/2.3.0/mkmf.rb:350:in `block in postpone' from C:/Ruby23-x64/lib/ruby/2.3.0/mkmf.rb:320:in `open' from C:/Ruby23-x64/lib/ruby/2.3.0/mkmf.rb:346:in `postpone' from C:/Ruby23-x64/lib/ruby/2.3.0/mkmf.rb:941:in `checking_for' from C:/Ruby23-x64/lib/ruby/2.3.0/mkmf.rb:1090:in `have_header' from extconf.rb:3:in `<main>' To see why this extension failed to compile, please check the mkmf.log which can be found here: C:/Ruby23-x64/lib/ruby/gems/2.3.0/extensions/x64-mingw32/2.3.0/nio4r-1.2.1/mkmf.log extconf failed, exit code 1
このようなエラーが発生します。
ちなみにmkmf.logには、
mkmf.log
1"x86_64-w64-mingw32-gcc -o conftest.exe -IC:/Ruby23-x64/include/ruby-2.3.0/x64-mingw32 -IC:/Ruby23-x64/include/ruby-2.3.0/ruby/backward -IC:/Ruby23-x64/include/ruby-2.3.0 -I. -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat conftest.c -L. -LC:/Ruby23-x64/lib -L. -lx64-msvcrt-ruby230 -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi " 2checked program was: 3/* begin */ 41: #include "ruby.h" 52: 63: #include <winsock2.h> 74: #include <windows.h> 85: int main(int argc, char **argv) 96: { 107: return 0; 118: } 12/* end */ 13 14
このように書かれています。
原因または解決策をご存知の方はいらっしゃいませんでしょうか。
僕はRailsのインストールが成功すると思いました。
なぜならhttps://openbook4.me/projects/92/sections/485(参考資料)には、
Gemをインストールするようにしてインストールすることができます。 gem install rails とすれば、最新のRailsがインストールされます。
と書かれているからです。
僕が原因を把握し、解決のために行った手順は以下です。
(1)コンフィグの確認
(2)実行するファイルを変更。
(3)実行するドライブを変更。
ですが、原因把握・解決には至りませんでした。
なお、僕の環境は以下の通りです。
・マシン - LIFEBOOK AH53/R (intel inside Core i7)
・メモリ量 - 8.00GB
・関連周辺機器 - 特になし
・OS - Windows10
・利用ソフト - Ruby コマンドプロンプト
・バージョン - Ruby:Ruby 2.3.1p112
Googleで[ruby on rails インストール エラー]と検索してみましたが、ほかのOSに関する情報ばかりで、解決に役立つ情報ではありませんでした。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。