LoginSignup
TaaaNaaa
@TaaaNaaa

Are you sure you want to delete the question?

Leaving a resolved question undeleted may help others!

bundle install失敗

解決したいこと

railsでのbundle installができません。

エラー文からmkmf.logの中身を確認し、足りないファイルを追加すれば良いことは分かったのですが、ログの中身からどのファイルをインストールすればよいのか分かりません。
ご教授願います。

発生している問題・エラー

Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions. This could take a while...
ERROR:  Error installing msgpack:
        ERROR: Failed to build gem native extension.

    current directory: C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/msgpack-1.5.6/ext/
msgpack
C:/Ruby31-x64/bin/ruby.exe -I C:/Ruby31-x64/lib/ruby/3.1.0 -r ./siteconf20220927
-9164-phxt0v.rb extconf.rb
checking for ruby/st.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:/Ruby31-x64/bin/$(RUBY_BASE_NAME)
        --with-ruby-dir
        --without-ruby-dir
        --with-ruby-include
        --without-ruby-include=${ruby-dir}/include
        --with-ruby-lib
        --without-ruby-lib=${ruby-dir}/lib
C:/Ruby31-x64/lib/ruby/3.1.0/mkmf.rb:498:in `try_do': The compiler failed to gen
erate an executable file. (RuntimeError)
You have to install development tools first.
        from C:/Ruby31-x64/lib/ruby/3.1.0/mkmf.rb:624:in `block in try_compile'
        from C:/Ruby31-x64/lib/ruby/3.1.0/mkmf.rb:573:in `with_werror'
        from C:/Ruby31-x64/lib/ruby/3.1.0/mkmf.rb:624:in `try_compile'
        from C:/Ruby31-x64/lib/ruby/3.1.0/mkmf.rb:1160:in `block in have_header'

        from C:/Ruby31-x64/lib/ruby/3.1.0/mkmf.rb:1007:in `block in checking_for
'
        from C:/Ruby31-x64/lib/ruby/3.1.0/mkmf.rb:362:in `block (2 levels) in po
stpone'
        from C:/Ruby31-x64/lib/ruby/3.1.0/mkmf.rb:332:in `open'
        from C:/Ruby31-x64/lib/ruby/3.1.0/mkmf.rb:362:in `block in postpone'
        from C:/Ruby31-x64/lib/ruby/3.1.0/mkmf.rb:332:in `open'
        from C:/Ruby31-x64/lib/ruby/3.1.0/mkmf.rb:358:in `postpone'
        from C:/Ruby31-x64/lib/ruby/3.1.0/mkmf.rb:1006:in `checking_for'
        from C:/Ruby31-x64/lib/ruby/3.1.0/mkmf.rb:1159: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:/Ruby31-x64/lib/ruby/gems/3.1.0/extensions/x64-mingw-ucrt/3.1.0/msgpack-1.5.
6/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/msgpac
k-1.5.6 for inspection.
Results logged to C:/Ruby31-x64/lib/ruby/gems/3.1.0/extensions/x64-mingw-ucrt/3.
1.0/msgpack-1.5.6/gem_make.out

mkmf.logの中身

PATH=".;C:/Ruby31-x64/lib;C:\Ruby31-x64\bin;C:\Ruby31-x64\msys64\ucrt64\bin;C:\Ruby31-x64\msys64\usr\bin;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\Microsoft VS Code\bin;C:\Program Files\MySQL\MySQL Shell 8.0\bin\;C:\Ruby31-x64\bin;C:\Users\Admin\AppData\Local\Programs\Python\Python36-32\Scripts\;C:\Users\Admin\AppData\Local\Programs\Python\Python36-32\;C:\Program Files\Microsoft VS Code\bin" "gcc -o conftest.exe -IC:/Ruby31-x64/include/ruby-3.1.0/x64-mingw-ucrt -IC:/Ruby31-x64/include/ruby-3.1.0/ruby/backward -IC:/Ruby31-x64/include/ruby-3.1.0 -I. -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0600 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -O3 -fno-fast-math -fstack-protector-strong conftest.c  -L. -LC:/Ruby31-x64/lib -L. -pipe -s -fstack-protector-strong -Wl,--no-as-needed  -m64   -lx64-ucrt-ruby310  -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi -lbcrypt  "
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: int main(int argc, char **argv)
6: {
7:   return !!argv[argc];
8: }
/* end */



0

1Answer

Rubyを再インストールし、Development Toolsを選択することによってコンパイラのインストールができ、railsサーバーが立ち上がりました。

0

Your answer might help someone💌