Ruby on rails 在windows 7上安装Rails 2.0.0 extconf.rb失败

Ruby on rails 在windows 7上安装Rails 2.0.0 extconf.rb失败,ruby-on-rails,Ruby On Rails,我正在尝试在我的计算机上安装rails 2.0.0。我已经在我的计算机上安装了ruby,运行 ruby -v 命令返回 ruby 2.0.0p247 (2013-06-27) [x64-mingw32] 现在,我正试图通过运行 gem install rails 但是,我遇到了一个错误: C:/Ruby200-x64/bin/ruby.exe extconf.rb *** extconf.rb failed *** Could not create Makefile due t

我正在尝试在我的计算机上安装rails 2.0.0。我已经在我的计算机上安装了ruby,运行

ruby -v 
命令返回

ruby 2.0.0p247 (2013-06-27) [x64-mingw32]
现在,我正试图通过运行

gem install rails 
但是,我遇到了一个错误:

    C:/Ruby200-x64/bin/ruby.exe extconf.rb
*** 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:/Ruby200-x64/bin/ruby
    --with-atomic_reference-dir
    --without-atomic_reference-dir
    --with-atomic_reference-include
    --without-atomic_reference-include=${atomic_reference-dir}/include
    --with-atomic_reference-lib
    --without-atomic_reference-lib=${atomic_reference-dir}/
C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:430:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
    from C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:515:in `try_link0'
    from C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:813:in `try_run'
    from extconf.rb:24:in `<main>'
然而,在运行gemrails安装之后,我仍然得到了相同的错误。我是否安装了错误的开发工具?我不确定出了什么问题

此外,如果这些信息相关,我将使用pik来控制我的ruby版本

注意:我检查了另一个可能的解决方案,它说我的userfolder中有空格,导致安装不可靠,但我的用户帐户中没有空格,所以这没有帮助

*编辑:包含更多信息的mkmf文件:

"x86_64-w64-mingw32-gcc -o conftest.exe -IC:/Ruby200-x64/include/ruby-2.0.0/x64-mingw32 -IC:/Ruby200-x64/include/ruby-2.0.0/ruby/backward -IC:/Ruby200-x64/include/ruby-2.0.0 -I. -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -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 -march=native conftest.c  -L. -LC:/Ruby200-x64/lib -L.      -lx64-msvcrt-ruby200  -lshell32 -lws2_32 -limagehlp -lshlwapi  "
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: int main(int argc, char **argv)
6: {
7:   return 0;
8: }
/* end */
"x86_64-w64-mingw32-gcc-o conftest.exe-IC:/Ruby200-x64/include/ruby-2.0.0/x64-mingw32-IC:/Ruby200-x64/include/ruby-2.0.0/ruby/backward-IC:/Ruby200-x64/include/ruby-2.0.0-I.-DFD_SETSIZE=2048-d32_WINNT=0x0501-D_FILE_OFFSET_BITS=64-O3-fno省略帧指针-fno快速数学-g-Wall-Wextra-Wno参数-Wno long long long-Wno缺少字段初始值设定项-Wunused变量-Wpointer arith-Wwrite strings-Wdeclaration after语句-Wimplicit函数声明-march=native conftest.c-L-LC:/Ruby200-x64/lib-L-lx64-lx64-msvcrt-Ruby200-lshell32-lws2_32-limagehlp-lshlwapi“
检查的程序是:
/*开始*/
1:#包括“ruby.h”
2: 
3:#包括
4:#包括
5:int main(int argc,字符**argv)
6: {
7:返回0;
8: }
/*结束*/

我也有类似的问题,所以如果你解决了你的问题(我想你现在一定已经解决了),你能发布解决方案吗?这并没有一个非常愉快的结局。我安装了Ubuntu的一个分区并运行了ruby/rails。你也可以尝试从中安装。它没有我需要的版本,但当我尝试它时,它使用了ruby 2.0和rails 3.2(?)好吧,如果内存可用的话。但是,我会说,我怀疑这是由于我的根文件命名约定。我读了一些资料,很明显,当您的用户文件夹中有空格时,安装程序出现了一些问题(例如“John Doe”)…把我的根用户文件夹改成实验文件夹太麻烦了。我觉得Windows是ruby/rails的二等公民。这里也必须安装ubuntu
"x86_64-w64-mingw32-gcc -o conftest.exe -IC:/Ruby200-x64/include/ruby-2.0.0/x64-mingw32 -IC:/Ruby200-x64/include/ruby-2.0.0/ruby/backward -IC:/Ruby200-x64/include/ruby-2.0.0 -I. -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -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 -march=native conftest.c  -L. -LC:/Ruby200-x64/lib -L.      -lx64-msvcrt-ruby200  -lshell32 -lws2_32 -limagehlp -lshlwapi  "
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: int main(int argc, char **argv)
6: {
7:   return 0;
8: }
/* end */