質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Windows 10

Windows 10は、マイクロソフト社がリリースしたOSです。Modern UIを標準画面にした8.1から、10では再びデスクトップ主体に戻され、UIも変更されています。PCやスマホ、タブレットなど様々なデバイスに幅広く対応していることが特徴です。

Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

Q&A

解決済

1回答

1888閲覧

????WindowsのRubyにてmailcatcherがインストールできない。

J_Igarashi

総合スコア1

Windows 10

Windows 10は、マイクロソフト社がリリースしたOSです。Modern UIを標準画面にした8.1から、10では再びデスクトップ主体に戻され、UIも変更されています。PCやスマホ、タブレットなど様々なデバイスに幅広く対応していることが特徴です。

Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

0グッド

0クリップ

投稿2021/12/21 07:20

編集2021/12/21 10:05

エディション Windows 10 Pro
バージョン 20H2
OS ビルド 19042.1415
エクスペリエンス Windows Feature Experience Pack 120.2212.3920.0

インストールしたのは、Ruby+Devkit 3.0.3-1 (x64)
ruby 3.0.3p157 (2021-11-24 revision 3fb7d2cadc) [x64-mingw32]

前提・実現したいこと

Windows10のRubyを用いてMailCatcher をインストールしようとしたところ、エラーが生じてしまいインストールできずにいます。

該当のソースコード

C:\>gem install mailcatcher Temporarily enhancing PATH for MSYS/MINGW... Building native extensions. This could take a while... ERROR: Error installing mailcatcher: ERROR: Failed to build gem native extension. current directory: C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/eventmachine-1.0.9.1/ext/fastfilereader C:/Ruby30-x64/bin/ruby.exe -I C:/Ruby30-x64/lib/ruby/3.0.0 -r ./siteconf20211221-25024-5d1u2s.rb extconf.rb checking for windows.h... yes checking for winsock.h... yes checking for -lkernel32... yes checking for -lrpcrt4... yes checking for -lgdi32... yes creating Makefile current directory: C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/eventmachine-1.0.9.1/ext/fastfilereader make DESTDIR\= clean current directory: C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/eventmachine-1.0.9.1/ext/fastfilereader make DESTDIR\= generating fastfilereaderext-x64-mingw32.def compiling mapper.cpp compiling rubymain.cpp In file included from C:/Ruby30-x64/msys64/mingw64/x86_64-w64-mingw32/include/wtypes.h:8, from C:/Ruby30-x64/msys64/mingw64/x86_64-w64-mingw32/include/winscard.h:10, from C:/Ruby30-x64/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:97, from C:/Ruby30-x64/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23, from C:/Ruby30-x64/include/ruby-3.0.0/ruby/win32.h:41, from C:/Ruby30-x64/include/ruby-3.0.0/ruby/internal/dosish.h:38, from C:/Ruby30-x64/include/ruby-3.0.0/ruby/defines.h:79, from C:/Ruby30-x64/include/ruby-3.0.0/ruby/ruby.h:23, from C:/Ruby30-x64/include/ruby-3.0.0/ruby.h:38, from rubymain.cpp:26: C:/Ruby30-x64/msys64/mingw64/x86_64-w64-mingw32/include/rpcndr.h:64:11: error: reference to 'byte' is ambiguous 64 | typedef byte cs_byte; | ^~~~ In file included from C:/Ruby30-x64/msys64/mingw64/include/c++/11.2.0/bits/stl_algobase.h:61, from C:/Ruby30-x64/msys64/mingw64/include/c++/11.2.0/bits/char_traits.h:39, from C:/Ruby30-x64/msys64/mingw64/include/c++/11.2.0/ios:40, from C:/Ruby30-x64/msys64/mingw64/include/c++/11.2.0/ostream:38, from C:/Ruby30-x64/msys64/mingw64/include/c++/11.2.0/iostream:39, from rubymain.cpp:22: ^~~~ In file included from C:/Ruby30-x64/msys64/mingw64/include/c++/11.2.0/bits/stl_algobase.h:61, from C:/Ruby30-x64/msys64/mingw64/include/c++/11.2.0/bits/char_traits.h:39, from C:/Ruby30-x64/msys64/mingw64/include/c++/11.2.0/ios:40, from C:/Ruby30-x64/msys64/mingw64/include/c++/11.2.0/ostream:38, from C:/Ruby30-x64/msys64/mingw64/include/c++/11.2.0/iostream:39, from rubymain.cpp:22: C:/Ruby30-x64/msys64/mingw64/include/c++/11.2.0/bits/cpp_type_traits.h:404:30: note: candidates are: 'enum class std::byte' 404 | enum class byte : unsigned char; | ^~~~ In file included from C:/Ruby30-x64/msys64/mingw64/x86_64-w64-mingw32/include/wtypes.h:8, from C:/Ruby30-x64/msys64/mingw64/x86_64-w64-mingw32/include/winscard.h:10, from C:/Ruby30-x64/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:97, from C:/Ruby30-x64/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23, from C:/Ruby30-x64/include/ruby-3.0.0/ruby/win32.h:41, from C:/Ruby30-x64/include/ruby-3.0.0/ruby/internal/dosish.h:38, from C:/Ruby30-x64/include/ruby-3.0.0/ruby/defines.h:79, from C:/Ruby30-x64/include/ruby-3.0.0/ruby/ruby.h:23, from C:/Ruby30-x64/include/ruby-3.0.0/ruby.h:38, from rubymain.cpp:26: C:/Ruby30-x64/msys64/mingw64/x86_64-w64-mingw32/include/rpcndr.h:63:25: note: 'typedef unsigned char byte' 63 | typedef unsigned char byte; | ^~~~ In file included from C:/Ruby30-x64/msys64/mingw64/x86_64-w64-mingw32/include/wtypes.h:8, from C:/Ruby30-x64/msys64/mingw64/x86_64-w64-mingw32/include/winscard.h:10, from C:/Ruby30-x64/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:97, from C:/Ruby30-x64/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23, from C:/Ruby30-x64/include/ruby-3.0.0/ruby/win32.h:41, from C:/Ruby30-x64/include/ruby-3.0.0/ruby/internal/dosish.h:38, from C:/Ruby30-x64/include/ruby-3.0.0/ruby/defines.h:79, from C:/Ruby30-x64/include/ruby-3.0.0/ruby/ruby.h:23, from C:/Ruby30-x64/include/ruby-3.0.0/ruby.h:38, from rubymain.cpp:26: C:/Ruby30-x64/msys64/mingw64/x86_64-w64-mingw32/include/rpcndr.h:397:170: error: 'byte' has not been declared 397 | typedef void (__RPC_API *CS_TYPE_TO_NETCS_ROUTINE)(RPC_BINDING_HANDLE hBinding,unsigned __LONG32 ulNetworkCodeSet,void *pLocalData,unsigned __LONG32 ulLocalDataLength,byte *pNetworkData,unsigned __LONG32 *pulNetworkDataLength,error_status_t *pStatus); | ^~~~ C:/Ruby30-x64/msys64/mingw64/x86_64-w64-mingw32/include/rpcndr.h:63:25: note: 'typedef unsigned char byte' 63 | typedef unsigned char byte; | ^~~~ make: *** [Makefile:237: rubymain.o] エラー 1 make failed, exit code 2 Gem files will remain installed in C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/eventmachine-1.0.9.1 for inspection. Results logged to C:/Ruby30-x64/lib/ruby/gems/3.0.0/extensions/x64-mingw32/3.0.0/eventmachine-1.0.9.1/gem_make.out

試したこと

Ruby+Devkit 2.7.5-1 (x64) でも試してみましたが、同様の箇所でエラーが出てしまいました。

追記 ~gem_make.out~

current directory: C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/eventmachine-1.0.9.1/ext/fastfilereader
C:/Ruby30-x64/bin/ruby.exe -I C:/Ruby30-x64/lib/ruby/3.0.0 -r ./siteconf20211221-24968-d6emd4.rb extconf.rb
checking for windows.h... yes
checking for winsock.h... yes
checking for -lkernel32... yes
checking for -lrpcrt4... yes
checking for -lgdi32... yes
creating Makefile

current directory: C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/eventmachine-1.0.9.1/ext/fastfilereader
make DESTDIR= clean

current directory: C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/eventmachine-1.0.9.1/ext/fastfilereader
make DESTDIR=
generating fastfilereaderext-x64-mingw32.def
compiling mapper.cpp
compiling rubymain.cpp
In file included from C:/Ruby30-x64/msys64/mingw64/x86_64-w64-mingw32/include/wtypes.h:8,
from C:/Ruby30-x64/msys64/mingw64/x86_64-w64-mingw32/include/winscard.h:10,
from C:/Ruby30-x64/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:97,
from C:/Ruby30-x64/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
from C:/Ruby30-x64/include/ruby-3.0.0/ruby/win32.h:41,
from C:/Ruby30-x64/include/ruby-3.0.0/ruby/internal/dosish.h:38,
from C:/Ruby30-x64/include/ruby-3.0.0/ruby/defines.h:79,
from C:/Ruby30-x64/include/ruby-3.0.0/ruby/ruby.h:23,
from C:/Ruby30-x64/include/ruby-3.0.0/ruby.h:38,
from rubymain.cpp:26:
C:/Ruby30-x64/msys64/mingw64/x86_64-w64-mingw32/include/rpcndr.h:64:11: error: reference to 'byte' is ambiguous
64 | typedef byte cs_byte;
| ^~~~
In file included from C:/Ruby30-x64/msys64/mingw64/include/c++/11.2.0/bits/stl_algobase.h:61,
from C:/Ruby30-x64/msys64/mingw64/include/c++/11.2.0/bits/char_traits.h:39,
from C:/Ruby30-x64/msys64/mingw64/include/c++/11.2.0/ios:40,
from C:/Ruby30-x64/msys64/mingw64/include/c++/11.2.0/ostream:38,
from C:/Ruby30-x64/msys64/mingw64/include/c++/11.2.0/iostream:39,
from rubymain.cpp:22:
~(中略)~

C:/Ruby30-x64/msys64/mingw64/include/c++/11.2.0/bits/cpp_type_traits.h:404:30: note: candidates are: 'enum class std::byte'
404 | enum class byte : unsigned char;
| ^~~~
In file included from C:/Ruby30-x64/msys64/mingw64/x86_64-w64-mingw32/include/wtypes.h:8,
from C:/Ruby30-x64/msys64/mingw64/x86_64-w64-mingw32/include/winscard.h:10,
from C:/Ruby30-x64/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:97,
from C:/Ruby30-x64/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
from C:/Ruby30-x64/include/ruby-3.0.0/ruby/win32.h:41,
from C:/Ruby30-x64/include/ruby-3.0.0/ruby/internal/dosish.h:38,
from C:/Ruby30-x64/include/ruby-3.0.0/ruby/defines.h:79,
from C:/Ruby30-x64/include/ruby-3.0.0/ruby/ruby.h:23,
from C:/Ruby30-x64/include/ruby-3.0.0/ruby.h:38,
from rubymain.cpp:26:
C:/Ruby30-x64/msys64/mingw64/x86_64-w64-mingw32/include/rpcndr.h:63:25: note: 'typedef unsigned char byte'
63 | typedef unsigned char byte;
| ^~~~
make: *** [Makefile:237: rubymain.o] 繧ィ繝ゥ繝シ 1

make failed, exit code 2

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

載せてあるエラーメッセージの最後に log の場所が書かれています。

これを読むとエラーの原因と 対策のヒント がかかれていると思います。最後の方。
たいていなんかのfileが足りないので取り寄せる ということになります。

ただ、
生のWindowsで build gem native extension. は厄介かも。今後こういうのが続々でてくるかと。
この問題解決のための手順でも出てくるかも。
今回のエラー対応方針を建てることが自力でできなかったのですから、それをクリアできるかどうか。

なんのためにrubyでの開発をやっているのか、によりますが 勉強のためであるなら 仮想環境でLinuxを動かしてそこでやることを薦めます

投稿2021/12/21 09:13

winterboum

総合スコア23340

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問