无法创建新的rails项目 - 错误:无法构建gem原生扩展

时间:2017-01-07 20:45:05

标签: ruby-on-rails ruby

我是Ruby和Ruby on Rails的新手,并试图让我的脚湿透。刚刚在Win 10 64位上安装了Ruby和ROR,并且从命令提示符看起来成功:

c:\>ruby -v
ruby 2.2.6p396 (2016-11-15 revision 56800) [x64-mingw32]

c:\>rails -v
Rails 5.0.1

但是,我无法创建项目,它返回以下内容:

c:\>rails new demo

Using tilt 2.0.5
Using sqlite3 1.3.13
Using turbolinks-source 5.0.0
Using tzinfo 1.2.2
Using nokogiri 1.7.0.1
Using rack-test 0.6.3
Using sprockets 3.7.1
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    C:/Ruby22-x64/bin/ruby.exe extconf.rb
C:/Ruby22-x64/bin/ruby.exe: No such file or directory -- extconf.rb (LoadError)

extconf failed, exit code 1

Gem files will remain installed in
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/nio4r-1.2.1 for inspection.
Results logged to
C:/Ruby22-x64/lib/ruby/gems/2.2.0/extensions/x64-mingw32/2.2.0/nio4r-1.2.1/gem_make.out

An error occurred while installing nio4r (1.2.1), and Bundler cannot continue.
Make sure that `gem install nio4r -v '1.2.1'` succeeds before bundling.

所以两个主要错误似乎是:

1)Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

我认为这可以通过在https://rubyinstaller.org/add-ons/devkit/安装DevKit来解决,但不能使用雪茄

2)C:/Ruby22-x64/bin/ruby.exe extconf.rb     C:/Ruby22-x64/bin/ruby.exe:没有这样的文件或目录 - extconf.rb(LoadError)

我不知道这个错误。 C:/Ruby22-x64/bin/ruby.exe是我系统上Ruby的正确途径。任何人都能解释一下吗?

0 个答案:

没有答案