前提・実現したいこと
ここに質問の内容を詳しく書いてください。
Windows10でrailsのアプリケーションを作ったのですが、以下を参考にAWSでデプロイを試みるもunicornに関するエラーが解決できず、完全に詰んでいる状況です。ちなみにエディターはVScodeです。
https://pikawaka.com/rails/ec2_deploy
以下のようなteratailの同じようなエラーは一通り調べたのですが、どれもmacが前提で全く参考になりませんでした。
https://teratail.com/questions/202302
発生している問題・エラーメッセージ
group :production do gem 'unicorn' end とGemfileに入力し、bundle installしたものの To see why this extension failed to compile, please check the mkmf.log which can be found here: C:/Ruby27-x64/lib/ruby/gems/2.7.0/extensions/x64-mingw32/2.7.0/kgio-2.11.4/mkmf.log extconf failed, exit code 1 Gem files will remain installed in C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/kgio-2.11.4 for inspection. Results logged to C:/Ruby27-x64/lib/ruby/gems/2.7.0/extensions/x64-mingw32/2.7.0/kgio-2.11.4/gem_make.out An error occurred while installing kgio (2.11.4), and Bundler cannot continue. Make sure that `gem install kgio -v '2.11.4' --source 'https://rubygems.org/'` succeeds before bundling. In Gemfile: unicorn was resolved to 6.0.0, which depends on kgio と出たので、上記の通り'gem install kgio -v '2.11.4' --source 'https://rubygems.org/'も試しましたが Temporarily enhancing PATH for MSYS/MINGW... Building native extensions. This could take a while... ERROR: Error installing kgio: ERROR: Failed to build gem native extension. current directory: C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/kgio-2.11.4/ext/kgio C:/Ruby27-x64/bin/ruby.exe -I C:/Ruby27-x64/lib/ruby/2.7.0 -r ./siteconf20210819-7196-9ka8l8.rb extconf.rb checking for CLOCK_MONOTONIC in time.h... yes checking for clockid_t in time.h... yes checking for clock_gettime() in -lrt... no checking for t_open() in -lnsl... no checking for socket() in -lsocket... no checking for poll() in poll.h... no checking for getaddrinfo() in sys/types.h,sys/socket.h,netdb.h... no getaddrinfo required *** 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:/Ruby27-x64/bin/$(RUBY_BASE_NAME) --with-rt-dir --without-rt-dir --with-rt-include --without-rt-include=${rt-dir}/include --with-rt-lib --without-rt-lib=${rt-dir}/lib --with-rtlib --without-rtlib --with-nsl-dir --without-nsl-dir --with-nsl-include --without-nsl-include=${nsl-dir}/include --with-nsl-lib --without-nsl-lib=${nsl-dir}/lib --with-nsllib --without-nsllib --with-socket-dir --without-socket-dir --with-socket-include --without-socket-include=${socket-dir}/include --with-socket-lib --without-socket-lib=${socket-dir}/lib --with-socketlib --without-socketlib To see why this extension failed to compile, please check the mkmf.log which can be found here: C:/Ruby27-x64/lib/ruby/gems/2.7.0/extensions/x64-mingw32/2.7.0/kgio-2.11.4/mkmf.log extconf failed, exit code 1 Gem files will remain installed in C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/kgio-2.11.4 for inspection. Results logged to C:/Ruby27-x64/lib/ruby/gems/2.7.0/extensions/x64-mingw32/2.7.0/kgio-2.11.4/gem_make.out と出ました。 あと少しでデプロイできそうなのに、もうこのエラーに1週間悩まされています。 どうか解決の糸口になるような知恵をいただきたく、質問させていただきます。
該当のソースコード
試したこと
上記で述べたもの以外であれば、
gem install kgio -v '2.11.4' --source 'https://rubygems.org/のコマンドの結果の
To see why this extension failed to compile, please check the mkmf.log which can be found here:
C:/Ruby27-x64/lib/ruby/gems/2.7.0/extensions/x64-mingw32/2.7.0/kgio-2.11.4/mkmf.log
extconf failed, exit code 1
の中にある
C:/Ruby27-x64/lib/ruby/gems/2.7.0/extensions/x64-mingw32/2.7.0/kgio-2.11.4/mkmf.log
こちらをエディターで見てみた結果
have_macro: checking for CLOCK_MONOTONIC in time.h... -------------------- yes
"x86_64-w64-mingw32-gcc -o conftest.exe -IC:/Ruby27-x64/include/ruby-2.7.0/x64-mingw32 -IC:/Ruby27-x64/include/ruby-2.7.0/ruby/backward -IC:/Ruby27-x64/include/ruby-2.7.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 -D_GNU_SOURCE -DPOSIX_C_SOURCE=1-D_POSIX_C_SOURCE=200112L -O3 -fno-fast-math -fstack-protector-strong conftest.c -L. -LC:/Ruby27-x64/lib -L. -pipe -s -fstack-protector-strong -lx64-msvcrt-ruby270 -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
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 */
"x86_64-w64-mingw32-gcc -IC:/Ruby27-x64/include/ruby-2.7.0/x64-mingw32 -IC:/Ruby27-x64/include/ruby-2.7.0/ruby/backward -IC:/Ruby27-x64/include/ruby-2.7.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 -D_GNU_SOURCE -DPOSIX_C_SOURCE=1-D_POSIX_C_SOURCE=200112L -O3 -fno-fast-math -fstack-protector-strong -c conftest.c"
checked program was:
/* begin /
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: #include <time.h>
6: /top/
7: #ifndef CLOCK_MONOTONIC
8: # error
9: |:/ === CLOCK_MONOTONIC undefined === /:|
10: #endif
/ end */
これに似たような文字列があと6つ書かれていたのですが、なんのことだか全くわからないため一度スルーしたぐらいです。
補足情報(FW/ツールのバージョンなど)
ruby(2.7.2),
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2021/10/01 06:01