2015-09-24 64 views
1

我是新來的紅寶石,並試圖建立我的開發環境(Windows 10)。我安裝了ruby和rails,但無法安裝。從我閱讀的內容開始,我首先需要DevKit。所以我按照這裏的指導安裝它:如何在Windows上安裝ruby的'byebug'?

https://github.com/oneclick/rubyinstaller/wiki/Development-Kit

,然後嘗試安裝寶石,但沒有運氣。 我試圖卸載,然後強制安裝DevKit,但仍不能通過安裝。 這就是我所看到的:

C:\RubySDK>gem install byebug 
Temporarily enhancing PATH to include DevKit... 
Building native extensions. This could take a while... 
ERROR: Error installing byebug: 
     ERROR: Failed to build gem native extension. 

    C:/Ruby22/bin/ruby.exe -r ./siteconf20150923-3628-5vg5h3.rb extconf.rb 
creating Makefile 

make "DESTDIR=" clean 

make "DESTDIR=" 
generating byebug-i386-mingw32.def 
compiling breakpoint.c 
In file included from c:/Ruby22/include/ruby-2.2.0/ruby.h:33:0, 
       from ./byebug.h:4, 
       from breakpoint.c:1: 
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:111:14: error: size of array 'ruby_check_sizeof_voidp' is negative 
In file included from c:/Ruby22/include/ruby-2.2.0/ruby.h:33:0, 
       from ./byebug.h:4, 
       from breakpoint.c:1: 
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h: In function 'rb_obj_freeze_inline': 
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1156:9: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1157:2: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1158:6: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1158:27: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h: In function 'rb_data_object_get': 
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1192:13: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h: In function 'rb_obj_written': 
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1271:10: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1271:34: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h: In function 'rb_num2char_inline': 
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1344:9: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1344:9: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1344:9: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1344:36: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1344:36: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1344:36: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1345:9: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1345:9: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1345:9: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h: In function 'rb_class_of': 
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1670:12: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h: In function 'rb_type': 
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1687:12: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 
breakpoint.c: In function 'eval_expression': 
breakpoint.c:21:45: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 
breakpoint.c:21:45: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 
breakpoint.c:21:45: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 
breakpoint.c: In function 'filename_cmp_impl': 
breakpoint.c:288:11: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 
breakpoint.c:288:11: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 
breakpoint.c:288:11: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 
breakpoint.c:292:16: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 
breakpoint.c:292:16: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 
breakpoint.c:292:16: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 
breakpoint.c: In function 'find_breakpoint_by_pos': 
breakpoint.c:458:10: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 
breakpoint.c:458:10: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 
breakpoint.c:458:10: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 
breakpoint.c:460:19: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 
breakpoint.c:460:19: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 
breakpoint.c:460:19: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 
breakpoint.c: In function 'find_breakpoint_by_method': 
breakpoint.c:480:19: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 
breakpoint.c:480:19: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 
breakpoint.c:480:19: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 
cc1.exe: all warnings being treated as errors 
make: *** [breakpoint.o] Error 1 

make failed, exit code 2 

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

是否有其他解決方法呢? 感謝

回答

0

發現問題。 看起來我正在使用錯誤的DevKit版本。我安裝64位時,我有一個32位紅寶石安裝

1

我知道這是一個很晚的答覆!

但是當你面對DevKit的困難,在這種情況下,你需要知道如果你的系統類型是64位,你必須使用一個RubyInstaller 64位和DevKit 64位。按照與32位系統類型相同的原則,使用RubyInstaller 32位和DevKit 32位

也不要忘了運行一些命令你安裝後,Ruby和Rails和的devkit,要做到這一點去的devkit的永久安裝通過終端(在windows CMD),然後運行:

命令:

  1. ruby dk.rb init - 這將創建配置文件
  2. 然後運行ruby dk.rb install

的乾杯d愉快的編碼。 Ibrax。