2013-07-25 2 views
1

루비 버전을 설정하지 않는이 올바른 나타납니다rbenv 내가 rbenv 성공적으로 설치 제대로

piousboxs-MacBook-Pro:lms piousbox$ cat .rbenv-version 
1.8.7-p374 
piousboxs-MacBook-Pro:lms piousbox$ ruby -v 
ruby 1.8.7 (2013-06-27 patchlevel 374) [i686-darwin12.2.1] 
piousboxs-MacBook-Pro:lms piousbox$ which ruby 
/Users/piousbox/.rbenv/shims/ruby 

을하지만 bundle을 실행할 때, 어떻게 든 시스템 루비를 사용?

Installing tiny_tds (0.5.1) 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. 

    /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb 
checking for iconv_open() in iconv.h... no 
checking for iconv_open() in -liconv... yes 
checking for sybfront.h... no 
----- 
freetds is missing. 
----- 
*** 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. 

아무도 도와 줄 수 있습니까?

답변

1

사용할 Ruby 버전을 설치하고 선택했는지 확인하십시오. rbenv install을 사용하여 다른 시스템을 추가 한 경우에도 rbenv은 기본적으로 시스템 1입니다.

어떤 Ruby rbenv이 사용되는지 보려면 rbenv version을 실행하십시오.

다른 컨텍스트에서 Ruby 버전을 설정하는 방법에 대한 자세한 내용은 rbenv local 또는 rbenv global 또는 rbenv shell을 참조하십시오.

0

에밀 (Emil) 앉아서, 문제는 어떻게하면 rbenv가 올바르게 구성되어 있더라도 freetds가 시스템 루비를 사용하려고한다는 것입니다.

Installing tiny_tds (0.5.1) 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. 

    /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb --ruby=/Users/piousbox/.rbenv/shims/ruby 
checking for iconv_open() in iconv.h... no 
checking for iconv_open() in -liconv... yes 
checking for sybfront.h... yes 
checking for sybdb.h... yes 
checking for tdsdbopen() in -lsybdb... no 
----- 
freetds is missing. 
----- 
*** 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 
    --enable-lookup 
    --disable-lookup 
    --with-iconv-dir 
    --without-iconv-dir 
    --with-iconv-include 
    --without-iconv-include=${iconv-dir}/include 
    --with-iconv-lib 
    --without-iconv-lib=${iconv-dir}/lib 
    --with-freetds-dir 
    --without-freetds-dir 
    --with-freetds-include 
    --without-freetds-include=${freetds-dir}/include 
    --with-freetds-lib 
    --without-freetds-lib=${freetds-dir}/lib 
    --with-iconvlib 
    --without-iconvlib 
    --with-sybdblib 
    --without-sybdblib 


Gem files will remain installed in /Users/piousbox/.bundler/tmp/26769/gems/tiny_tds-0.5.1 for inspection. 
Results logged to /Users/piousbox/.bundler/tmp/26769/gems/tiny_tds-0.5.1/ext/tiny_tds/gem_make.out 

An error occurred while installing tiny_tds (0.5.1), and Bundler cannot continue. 
Make sure that `gem install tiny_tds -v '0.5.1'` succeeds before bundling. 
0

것은 당신이 gem install bundler에 들러를 설치 한 후 rbenv rehash을 실행했는지 확인 : 기본 확장을 구축 할 때 전달되는이 --ruby 플래그가있다.

0

해결 방법은 시스템 제공 번들러를/usr/local/bundle에서 제거하는 것입니다. 이는 구식이므로 잘 작동하지 않기 때문입니다. 새로운 루비 (rbenv를 통해)와 번들러 (새로운 루비를 통해)로 모든 것을 정확하게 컴파일 할 수있었습니다.