Rails could not install

已完成

Good day,

I tried to create a new Rails App in RubyMine, it asked to select and install Rails version and then i keep getting the error below. I have searched google several and tried alot of things, i also installed nogokiri all to no avail. Please help


Following gems were not installed: rails (5.1.1): Error installing rails: ERROR: Failed to build gem native extension. current directory: C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/nio4r-2.0.0/ext/nio4r C:/Ruby24-x64/bin/ruby.exe -r ./siteconf20170528-3564-6jqe6p.rb extconf.rb checking for unistd.h... *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary Temporarily enhancing PATH for MSYS/MINGW... libraries and/or headers. Check the mkmf.log file for more details. You may Building native extensions. This could take a while... 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 generate 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 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: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 ` ' 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.0.0/mkmf.log extconf failed, exit code 1 Gem files will remain installed in C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/nio4r-2.0.0 for inspection. Results logged to C:/Ruby24-x64/lib/ruby/gems/2.4.0/extensions/x64-mingw32/2.4.0/nio4r-2.0.0/gem_make.out Native compilation failed. Please make sure that you have Ruby DevKit installed

1

Hello, 

Please check if Development Kit is installed for mentioned Ruby. You can find compatible version here https://rubyinstaller.org/downloads/.

0

Hello Anna,

Starting with Ruby 2.4.0, DevKit is replaced by the MSYS2 toolkit. Which i downloaded and using

 

regards

0

Thanks for quick answer, and does it work in Command Line?

0

No it does not work, after doing this, i tried to install rails via command line and also via RubyMine but i get the same error

0

Looks like Rails works with Ruby 2.4.0 on Windows not very stable yet. I need some time to check in my environment. But if it doesn't work in the command line - it's definitely problem of environment:(

0

ok, i am waiting. Can we have a live or direct chat maybe via skype to go direct on this?

0

Hello Anna,

I finally got it fixed, i used the tip from the link below which is in japanese after i translated to English
https://translate.google.com/translate?hl=en&sl=ja&tl=en&u=http%3A%2F%2Fqiita.com%2FKTakata%2Fitems%2F1f30b8571764f7801708

Thanks again and have a great day ahead

 

cheers

1

Oh, really great and thanks for your investigation, I will use it as well:) Have  a nice day too.

0

请先登录再写评论。