0

私はRubyとGemsを初めて使用するので、明らかな何かが欠けている可能性があります。

ERROR:  Error installing matlab-ruby:
    ERROR: Failed to build gem native extension.

        /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb

Ruby GSLなど、いくつかのGemsでエラーが発生しました。

重要な場合は、Mac OS 10.7.2、Ruby 1.8.7、およびXCode4.2を実行しています。

フルコンソール出力:

Building native extensions.  This could take a while...
ERROR:  Error installing gsl:
    ERROR: Failed to build gem native extension.

        /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
extconf.rb:1: command not found: gsl-config --version
*** 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=/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
extconf.rb:237: Check GSL>=0.9.4 is installed, and the command "gsl-config" is in search path. (RuntimeError)
checking gsl version... 

Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/gsl-1.14.7 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/gsl-1.14.7/ext/gem_make.out
4

1 に答える 1

2

ついにgslがインストールされました!

重要なことは、使用しているrb-gslのバージョン(私の場合は1.14)と一致するバージョンのgslをインストールすることです。

私のようにcでがらくたをコンパイルすることについて何も知らない人のために:

gslパッケージをダウンロードして解凍します。ターミナルでそのフォルダーに移動します。次のコマンドを入力します。

./configure
make clean
make
sudo make install

make installコマンドは、標準の場所にインストールすると思いますか?

私がそれをしたら、

sudo gem install gsl

うまくいきました!

また、ネイティブ拡張機能を備えたgemのインストールと、これらすべてが実際に行っていることについてのこのすばらしい紹介記事を見つけました。

http://patshaughnessy.net/2011/10/31/dont-be-terrified-of-building-native-extensions

于 2011-11-19T05:11:29.497 に答える