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

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

新規登録して質問してみよう
ただいま回答率
85.51%
Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

Q&A

解決済

1回答

2230閲覧

[Ruby]Ruby on Railsの環境構築での不具合

asadako

総合スコア147

Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

0グッド

0クリップ

投稿2016/12/22 10:40

編集2016/12/22 10:46

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に関する情報ばかりで、解決に役立つ情報ではありませんでした。

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

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

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

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

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

guest

回答1

0

自己解決

Development Kitをインストールすると正常にインストールできました。

投稿2016/12/22 11:01

asadako

総合スコア147

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

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

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.51%

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

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

質問する

関連した質問