2016-09-01 5 views
0

Ruby 개발 환경을 이식성있게 만들고자하는데 DevKit을 지역화하는 몇 가지 문제가있었습니다. 그것은 잘 설치했지만, 내가 그것을 요구하는 보석을 설치하려고 할 때 (이 경우, wdm). mkmf.log의 내용은 아래에서 확인할 수 있습니다 루비 설치가 제대로 작동Ruby가 네이티브 젬을 만들지 못했습니다.

"gcc -o conftest.exe -IE:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0/i386-mingw32 -IE:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0/ruby/backward -IE:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0 -I. -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -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 -Wdeprecated-declarations -Wno-packed-bitfield-compat conftest.c -L. -LE:/Resources/Windows/Software/Ruby/RubyPortable/lib -L.  -lmsvcrt-ruby230 -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi " 
In file included from E:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0/ruby.h:33:0, 
       from conftest.c:1: 
E:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0/ruby/ruby.h:131:14: error: size of array 'ruby_check_sizeof_voidp' is negative 
In file included from E:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0/ruby.h:33:0, 
       from conftest.c:1: 
E:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0/ruby/ruby.h: In function 'rb_obj_freeze_inline': 
E:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0/ruby/ruby.h:1360:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 
E:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0/ruby/ruby.h:1361:2: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 
E:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0/ruby/ruby.h:1362:6: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 
E:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0/ruby/ruby.h:1362:27: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 
E:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0/ruby/ruby.h: In function 'rb_data_object_get': 
E:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0/ruby/ruby.h:1400:13: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 
E:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0/ruby/ruby.h: In function 'rb_data_object_make': 
E:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0/ruby/ruby.h:1414:5: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 
E:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0/ruby/ruby.h: In function 'rb_data_typed_object_make': 
E:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0/ruby/ruby.h:1421:5: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 
E:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0/ruby/ruby.h: In function 'rb_num2char_inline': 
E:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0/ruby/ruby.h:1587:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 
E:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0/ruby/ruby.h:1587:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 
E:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0/ruby/ruby.h:1587:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 
E:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0/ruby/ruby.h:1587:41: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 
E:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0/ruby/ruby.h:1587:41: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 
E:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0/ruby/ruby.h:1587:41: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 
E:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0/ruby/ruby.h:1588:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 
E:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0/ruby/ruby.h:1588:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 
E:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0/ruby/ruby.h:1588:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 
E:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0/ruby/ruby.h: In function 'rb_class_of': 
E:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0/ruby/ruby.h:1949:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 
E:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0/ruby/ruby.h: In function 'rb_type': 
E:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0/ruby/ruby.h:1966:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 
In file included from E:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0/ruby.h:33:0, 
       from conftest.c:1: 
E:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0/ruby/ruby.h: In function 'rb_clone_setup': 
E:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0/ruby/ruby.h:1997:56: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 
E:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0/ruby/ruby.h:1998:33: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 
E:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0/ruby/ruby.h:1999:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 
E:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0/ruby/ruby.h:1999:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 
E:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0/ruby/ruby.h: In function 'rb_dup_setup': 
E:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0/ruby/ruby.h:2005:42: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 
E:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0/ruby/ruby.h:2006:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 
E:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0/ruby/ruby.h:2006:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 
E:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0/ruby/ruby.h: In function 'rb_array_len': 
E:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0/ruby/ruby.h:2012:13: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 
E:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0/ruby/ruby.h:2013:2: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 
E:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0/ruby/ruby.h:2013:24: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 
E:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0/ruby/ruby.h: In function 'rb_array_const_ptr': 
E:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0/ruby/ruby.h:2027:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 
E:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0/ruby/ruby.h:2027:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 
E:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0/ruby/ruby.h:2027:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 
E:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0/ruby/ruby.h: In function 'rb_struct_len': 
E:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0/ruby/ruby.h:2034:13: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 
E:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0/ruby/ruby.h:2035:2: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 
E:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0/ruby/ruby.h:2035:26: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 
E:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0/ruby/ruby.h: In function 'rb_struct_const_ptr': 
E:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0/ruby/ruby.h:2041:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 
E:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0/ruby/ruby.h:2041:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 
E:/Resources/Windows/Software/Ruby/RubyPortable/include/ruby-2.3.0/ruby/ruby.h:2041:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 
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: } 

, 나는이 원인을 모르겠어요. devkit은 작동하지 않지만 DevKit은 작동하지 않습니다 ...

답변

0

사물의 외형에서, 당신은 꽤 가까이에 있고 거의 이것을 수행했거나 gcc을 귀하의 PATH에 가지고 있습니다. 어딘가 DevKit이 아니지만, 내가 간다면 어떻게 할 것인지 전체 프로세스를 설명 할 것입니다. 참고 : 나는 절대 원하지 않습니다. =이 답변으로 인해 발생하는 모든 것들의 진짜 조밀 (

. 즉
, 당신은 정말이 일을 만들고 싶어한다.
코드를 복사/붙여 넣기를 기대하지 마십시오 사물이 무슨 일이 일어나고 있는지 이해하지 않고 작동합니다.

DevKit는 절대 경로와 함께 "설치". 당신이 그것을 작동하게하는 정말 더러운 일을해야합니다 것을 변경합니다.

rbDevKit을로드하는 파일은 실제로 <ruby>이 루트 설치 디렉토리라고 가정하고 <ruby>/lib/ruby/site_ruby/devkit.rb에 있습니다. 그러니 그걸 열어야합니다.
참고 :이 파일은 설치 프로세스의 다른 부분에서로드됩니다.

그러자 devkit 폴더 위치하여 예 ruby 폴더 같은 위치에 있다고 가정E:\folderA\rubyE:\FolderA\devkit이 같은 것을보고 그것을 변경해야합니다 : 위치가 달라진 것입니다

# enable RubyInstaller DevKit usage as a vendorable helper library 
devkit_root = File.expand_path(File.join(File.dirname(__FILE__), '../../../..', 'devkit')) 
msys_bin_path = File.join(devkit_root, 'bin').gsub(File::SEPARATOR, File::ALT_SEPARATOR) 
mingw_bin_path = File.join(devkit_root, 'mingw', 'bin').gsub(File::SEPARATOR, File::ALT_SEPARATOR) 

unless ENV['PATH'].include?(mingw_bin_path) then 
    phrase = 'Temporarily enhancing PATH to include DevKit...' 
    if defined?(Gem) 
    Gem.ui.say(phrase) if Gem.configuration.verbose 
    else 
    puts phrase 
    end 
    puts "Prepending ENV['PATH'] to include DevKit..." if $DEBUG 
    ENV['PATH'] = "#{msys_bin_path};#{mingw_bin_path};" + ENV['PATH'] 
end 
ENV['RI_DEVKIT'] = devkit_root.gsub(File::SEPARATOR, File::ALT_SEPARATOR) 
ENV['CC'] = 'gcc' 
ENV['CXX'] = 'g++' 
ENV['CPP'] = 'cpp' 

경우에 당신이 devkit_root 상대적 가입 변경해야합니다.
경로가 존재하는지 확인하려면 expand_path 대신 realpath을 사용할 수 있습니다. 이 모두가 비슷하면

자, 다음은 설치하려는 보석의 extconf.rb에서 Makefile 세대 아마 일이다. 어떤 경우에, 당신은 gem에 그것을 고쳐야 할 것이고 아마 당신이 자선을 느끼고 있다면 PR을 열어야 할 것입니다. 그러나 그것은 또한 다른 것들이 잘못 될 수도 있습니다. 따라서 본질적으로 YMMV입니다.

+1

"DevKit"의 아키텍처가 잘못되었습니다. 똑똑한거야? - .- – RhysO