所以我尝试使用railsinstaller.org的RailsInstaller将Rails安装到我的Windows。
一切正常,直到我使用'gem install rails'并弹出此错误代码:
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
current directory: D:/Misc/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/nio4r-1.2.1/ext/nio4r
D:/Misc/RailsInstaller/Ruby2.2.0/bin/ruby.exe -r ./siteconf20160715-720-115hc2e.rb extconf.rb
D:/Misc/RailsInstaller/Ruby2.2.0/bin/ruby.exe: No such file or directory --extconf.rb (LoadError)
extconf failed, exit code 1
Gem files will remain installed in D:/Misc/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/nio4r-1.2.1 for inspection.
Results logged to D:/Misc/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/extensions/x86-mingw32/2.2.0/nio4r-1.2.1/gem_make.out
即使安装了x64版本,错误仍然存在。
Building native extensions. This could take a while...
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
current directory: D:/Misc/Ruby23-x64/lib/ruby/gems/2.3.0/gems/nio4r-1.2.1/ext/nio4r
D:/Misc/Ruby23-x64/bin/ruby.exe -r ./siteconf20160715-7956-15ui18c.rb extconf.rb
D:/Misc/Ruby23-x64/bin/ruby.exe: No such file or directory -- extconf.rb (LoadError)
extconf failed, exit code 1
Gem files will remain installed in D:/Misc/Ruby23-x64/lib/ruby/gems/2.3.0/gems/nio4r-1.2.1 for inspection.
Results logged to D:/Misc/Ruby23-x64/lib/ruby/gems/2.3.0/extensions/x64-mingw32/2.3.0/nio4r-1.2.1/gem_make.out
我检查了所说的目录,文件肯定在那里。我已经尝试重新安装,结果是一样的。此外,我知道堆栈溢出周围有很多类似的问题,但它们似乎都没有对这个问题有帮助,所以请原谅我。
非常感谢任何帮助。