いつもお世話になります。
Ruby、Ruby on railsに関しては全くの初心者のため、間違ったことなど多いとは思いますがご容赦いただけますと助かります。
https://techacademy.jp/magazine/7058
上記の記事を参考にrubyとdevkitを入れるところまではできたのですが、gem install railsを実行したときにエラーが出てしまいます。
エラー内容は下記のとおりで、いろいろ調べてみたのですがnio4rのエラーについての記事はうまく発見することができず難航しております。mkmf.logを見ても全くわからず……。
ご助力いただけますと助かります。
よろしくお願いいたします。
ruby -vは下記の通り実行されます。
C:\Users\XXXX>ruby -v
ruby 2.4.1p111 (2017-03-22 revision 58053) [x64-mingw32]
C:\Users\XXXX>gem install rails Fetching: activesupport-5.1.3.gem (100%) Successfully installed activesupport-5.1.3 Fetching: actionview-5.1.3.gem (100%) Successfully installed actionview-5.1.3 Fetching: actionpack-5.1.3.gem (100%) Successfully installed actionpack-5.1.3 Fetching: activemodel-5.1.3.gem (100%) Successfully installed activemodel-5.1.3 Fetching: activerecord-5.1.3.gem (100%) Successfully installed activerecord-5.1.3 Fetching: activejob-5.1.3.gem (100%) Successfully installed activejob-5.1.3 Fetching: actionmailer-5.1.3.gem (100%) Successfully installed actionmailer-5.1.3 Temporarily enhancing PATH to include DevKit... Building native extensions. This could take a while... ERROR: Error installing rails: ERROR: Failed to build gem native extension. current directory: C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/nio4r-2.1.0/ext/ni o4r C:/Ruby24-x64/bin/ruby.exe -r ./siteconf20170806-8120-6a2ufm.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:/Ruby24-x64/bin/$(RUBY_BASE_NAME) C:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:457:in `try_do': The compiler failed to gen erate an executable file. (RuntimeError) You have to install development tools first. from C:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:588:in `try_cpp' from C:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:1095:in `block in have_header' from C:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:945:in `block in checking_for' from C:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:351:in `block (2 levels) in po stpone' from C:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:321:in `open' from C:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:351:in `block in postpone' from C:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:321:in `open' from C:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:347:in `postpone' from C:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:944:in `checking_for' from C:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:1094:in `have_header' from extconf.rb:5:in `<main>' To see why this extension failed to compile, please check the mkmf.log which can be found here: C:/Ruby24-x64/lib/ruby/gems/2.4.0/extensions/x64-mingw32/2.4.0/nio4r-2.1.0/mkm f.log extconf failed, exit code 1 Gem files will remain installed in C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/nio4r- 2.1.0 for inspection. Results logged to C:/Ruby24-x64/lib/ruby/gems/2.4.0/extensions/x64-mingw32/2.4.0 /nio4r-2.1.0/gem_make.out
mkmf.log
1"x86_64-w64-mingw32-gcc -o conftest.exe -IC:/Ruby24-x64/include/ruby-2.4.0/x64-mingw32 -IC:/Ruby24-x64/include/ruby-2.4.0/ruby/backward -IC:/Ruby24-x64/include/ruby-2.4.0 -I. -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -IC:/msys64/mingw64/lib/libffi-3.2.1/include -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -march=x86-64 -mtune=generic -O2 -pipe -IC:/msys64/mingw64/lib/libffi-3.2.1/include conftest.c -L. -LC:/Ruby24-x64/lib -L. -pipe -lx64-msvcrt-ruby240 -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi " 2c:/devkit/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lgmp 3collect2.exe: error: ld returned 1 exit status 4checked program was: 5/* begin */ 61: #include "ruby.h" 72: 83: #include <winsock2.h> 94: #include <windows.h> 105: int main(int argc, char **argv) 116: { 127: return 0; 138: } 14/* end */
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。