2

Rails アプリ用に Windows XP でテスト エージェントをセットアップしています。

エージェント間の一貫性を確保するために、RVM と Cygwin を使用して Bundler を介してインストールしています。

以下は、プロジェクト ディレクトリで bundle install を実行した結果です (編集: gem install bcrypt-ruby を実行すると同じ出力が生成されることに注意してください)。

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /goBaltoEngineering/.rvm/rubies/ruby-1.9.3-p125/bin/ruby.exe extconf.rb
creating Makefile

make
compiling bcrypt_ext.c
compiling crypt.c
compiling crypt_blowfish.c
compiling crypt_gensalt.c
compiling wrapper.c
In file included from wrapper.c:27:0:
/goBaltoEngineering/.rvm/rubies/ruby-1.9.3-p125/include/ruby-1.9.1/ruby/backward/util.h:2:2: warning: #warning use "ruby/util.h" instead of bare     "util.h"
linking shared-object bcrypt_ext.so
bcrypt_ext.o:bcrypt_ext.c:(.text+0x29): undefined reference to `_ruby_bcrypt'
collect2: ld returned 1 exit status
Makefile:207: recipe for target `bcrypt_ext.so' failed
make: *** [bcrypt_ext.so] Error 1


Gem files will remain installed in /goBaltoEngineering/.rvm/gems/ruby-1.9.3-p125@togo/gems/bcrypt-ruby-3.0.1 for inspection.
Results logged to /goBaltoEngineering/.rvm/gems/ruby-1.9.3-p125@togo/gems/bcrypt-ruby-3.0.1/ext/mri/gem_make.out
An error occurred while installing bcrypt-ruby (3.0.1), and Bundler cannot continue.
Make sure that `gem install bcrypt-ruby -v '3.0.1'` succeeds before bundling.

cygwin gcc パッケージがインストールされています。

$ whereis gcc
gcc: /bin/gcc.exe /usr/bin/gcc.exe /lib/gcc /usr/lib/gcc /cygdrive/e/Cygwin/bin/gcc.exe /usr/share/man/man1/gcc.1.gz


$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-pc-cygwin/4.5.3/lto-wrapper.exe
Target: i686-pc-cygwin
Configured with: /gnu/gcc/releases/respins/4.5.3-3/gcc4-4.5.3-3/src/gcc-4.5.3/configure    --srcdir=/gnu/gcc/releases/respins/4.5.3-3/gcc4-4.5.3-3/src/gcc-4.5.3 --prefix=/usr --exec-  prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/lib -- datadir=/usr/share --localstatedir=/var --sysconfdir=/etc --datarootdir=/usr/share -- docdir=/usr/share/doc/gcc4 -C --datadir=/usr/share --infodir=/usr/share/info -- mandir=/usr/share/man -v --with-gmp=/usr --with-mpfr=/usr --enable-bootstrap --enable-version-specific-runtime-libs --libexecdir=/usr/lib --enable-static --enable-shared --enable-shared-libgcc --disable-__cxa_atexit --with-gnu-ld --with-gnu-as --with-dwarf2 --disable-sjlj-exceptions --enable-languages=ada,c,c++,fortran,java,lto,objc,obj-c++ --enable-graphite --enable-lto --enable-java-awt=gtk --disable-symvers --enable-libjava --program-suffix=-4 --enable-libgomp --enable-libssp --enable-libada --enable-threads=posix --with-arch=i686 --with-tune=generic --enable-libgcj-sublibs CC=gcc-4 CXX=g++-4 CC_FOR_TARGET=gcc-4 CXX_FOR_TARGET=g++-4 GNATMAKE_FOR_TARGET=gnatmake GNATBIND_FOR_TARGET=gnatbind --with-ecj-jar=/usr/share/java/ecj.jar
Thread model: posix
gcc version 4.5.3 (GCC)

bcrypt と同様:

 $ whereis bcrypt
 bcrypt: /bin/bcrypt.exe /usr/bin/bcrypt.exe /cygdrive/e/Cygwin/bin/bcrypt.exe /usr/share/man/man1/bcrypt.1.gz

 bcrypt -v
 bcrypt: unknown option -- v
 Usage is: /bin/bcrypt -[orc][-sN] file1 file2..
   -o Write output to standard out
   -r Do NOT remove input files after processing
   -c Do NOT compress files before encryption
   -sN How many times to overwrite input files with random data

さらなる研究の結果:

設定

        rvm use system

(私の場合は1.9.3-p286)bcrypt-rubyを問題なくインストールできます

rvm と設定による 1.9.3-p286 のインストール

        rvm use 1.9.3-p286

同一の (ruby バージョンを除く) エラーメッセージが表示されます。

Mac OS X へのインストールは、多数の開発者ステーションと複数の Mac エージェントで問題なく動作します。

これはすべて、エラーが rvm と cygwin の交差点にあることを示唆しています。

私は思いつくことができるすべてを試しました。どんな助けでも大歓迎です。

ありがとうございました

4

1 に答える 1

0

私は次の方法でそれをかわしました:私のバージョンのRuby用のRubyinstallerをインストールします:

http://rubyinstaller.org/

パスから Cygwin を削除します ([マイ コンピューター] を右クリックし、[プロパティ] > [詳細設定] > [環境変数] をクリックします)。

Git Bash をダウンロードし、次の手順に従って ssh をセットアップしました。

http://mrsimonelliott.com/blog/setting-git-and-github-windows-xp

ダウンロードした Ruby インストーラー DevKit

http://rubyinstaller.org/add-ons/devkit/

ダウンロードした QT

http://qt-project.org/downloads (mingw ディレクトリは Git をインストールした場所にあります)

パスに QT/bin を追加しました。

私はRubyのバージョンしか手に入れていませんが、これが問題になったときはいつでもPikを使用できると思います.

ちなみに、これはRVMの問題だと確信しています。

于 2012-10-28T22:35:59.220 に答える