即使安裝ffi gem(使用正確版本1.0.11),我的軟件包安裝仍無法在我的mac上安裝ffi。Bundle安裝失敗安裝ffi(由於env命令錯誤?)
Installing ffi (1.0.11) with native extensions Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. ... creating Makefile make Configuring libffi for i386 env: --disable-static: No such file or directory make[1]: *** No targets specified and no makefile found. Stop. Configuring libffi for x86_64 env: --disable-static: No such file or directory make[1]: *** No targets specified and no makefile found. Stop. make: *** ["/mypath/clients/myapp/rails=2.3.5/ruby/1.8/gems/ffi-1.0.11/ext/ffi_c/libffi"/.libs/libffi_convenience.a] Error 2 An error occured while installing ffi (1.0.11), and Bundler cannot continue. Make sure that `gem install ffi -v '1.0.11'` succeeds before bundling.
我試圖
gem install ffi -v '1.0.11'
它通過就好了去了:運行時「包安裝」我得到了下面的錯誤。 然後我查看失敗的Makefile並運行
make -n以查看發生了什麼。原來,廠名失敗的命令:
cd "/mypath/clients/myapp/rails=2.3.5/ruby/1.8/gems/ffi-1.0.11/ext/ffi_c"/libffi-$arch && env CC=" gcc" CFLAGS="-arch $arch " LDFLAGS="-arch $arch" "/mypath/clients/myapp/rails=2.3.5/ruby/1.8/gems/ffi-1.0.11/ext/ffi_c/libffi"/configure --disable-static --with-pic=yes --disable-dependency-tracking --host=$arch-apple-darwin > /dev/null;
具體而言,它沒有對
env CC=" gcc" CFLAGS="-arch $arch " LDFLAGS="-arch $arch" "/mypath/clients/myapp/rails=2.3.5/ruby/1.8/gems/ffi-1.0.11/ext/ffi_c/libffi"/configure --disable-static --with-pic=yes --disable-dependency-tracking --host=$arch-apple-darwin > /dev/null;
顯然env命令認爲部分
"/mypath/clients/myapp/rails=2.3.5/ruby/1.8/gems/ffi-1.0.11/ext/ffi_c/libffi"/configure是因爲路徑中包含「=設置環境變量」。如果我手動將「=」更改爲「_」,env命令就可以正常工作。但是,此路徑是由「捆綁安裝」自動生成的,並且它一直在工作。
我剛剛嘗試過
bundle install --path=rails_2.3.5並且通過了。但我仍然想知道過去的路徑軌道= 2.3.5是如何工作的。
是因爲我不小心改變了我的Mac上的一些設置?我可以讓env認識到引號中的「=」不適用於環境變量嗎?
非常感謝。
此外,您可能需要安裝/重新安裝https://github.com/kennethreitz/osx-gcc-installer。升級到Mountain Lion後,我的安裝被破壞。用ffi重新安裝osx-gcc固定的roblem。 –