[ruby] 10.10 Yosemite에 Rubyracer gem을 설치하는 방법은 무엇입니까?

Yosemite 10.10에 Rubyracer gem을 설치할 수 없습니다.

다음은 로그입니다.

11:53 $ gem install libv8 -v '3.16.14.3'---with-system-v8


'--with-system-v8'을 사용하여 기본 확장 빌드
시간이 좀 걸릴 수 있습니다 ...
libv8-3.16.14.3을 성공적으로 설치했습니다.
libv8-3.16.14.3에 대한 구문 분석 문서
libv8-3.16.14.3 용 ri 문서 설치
0 초 후 libv8에 대한 문서 설치 완료
보석 1 개 설치


02:05 $ gem install therubyracer -v '0.12.1'---with-system-v8


'--with-system-v8'을 사용하여 기본 확장 빌드
시간이 좀 걸릴 수 있습니다 ...
오류 : Rubyracer 설치 오류 :
    오류 : gem 기본 확장을 빌드하지 못했습니다.

    /usr/local/var/rbenv/versions/2.1.2/bin/ruby extconf.rb --with-system-v8
-lpthread에서 main () 확인 중 ... 예
-lobjc에서 main () 확인 중 ... 예
v8.h 확인 중 ... 아니요
*** extconf.rb 실패 ***
어떤 이유로 인해 Makefile을 만들 수 없습니다. 아마도 필요하지 않을 것입니다.
라이브러리 및 / 또는 헤더. 자세한 내용은 mkmf.log 파일을 확인하십시오. 당신은 할 수있다
구성 옵션이 필요합니다.

제공된 구성 옵션 :
    --opt-dir 포함
    --opt-dir없이
    -선택 포함 포함
    --without-opt-include = $ {opt-dir} / include
    --opt-lib 사용
    --without-opt-lib = $ {opt-dir} / lib
    --with-make-prog
    --- make-prog없이
    --srcdir =.
    --curdir
    --ruby = / usr / local / var / rbenv / versions / 2.1.2 / bin / ruby
    --pthreadlib 사용
    --pthreadlib없이
    --with-objclib
    --objclib없이
    -디버그 활성화
    -디버그 비활성화
    --v8-dir 사용
    --v8-dir없이
    --with-v8-include
    --without-v8-include = $ {v8-dir} / include
    --v8-lib 사용
    --without-v8-lib = $ {v8-dir} / lib
/usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/libv8-3.16.14.3/ext/libv8/location.rb:50:in`configure ': 시스템에있는 V8 버전을 사용하도록 선택했습니다 (Libv8 :: Location :: System :: NotFoundError).
libv8 rubygem과 함께 번들로 제공되는 것은 * 아닙니다 *. 하나,
찾을 수 없습니다. 버전이 있는지 확인하십시오
3.16.14.3과 호환되는 v8이 설치되어 있습니다. 당신은 할 수있다
비표준 인 경우 특별한 --with-v8-dir 옵션이 필요합니다.
위치

감사,
관리

    /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/libv8-3.16.14.3/lib/libv8.rb:7 : 'configure_makefile'에서
    extconf.rb : 32 : in` '에서

extconf 실패, 종료 코드 1

Gem 파일은 검사를 위해 /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/therubyracer-0.12.1에 설치되어 있습니다.
결과는 /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/extensions/x86_64-darwin-14/2.1.0-static/therubyracer-0.12.1/gem_make에 기록되었습니다. 밖



답변

git clone https://github.com/cowboyd/libv8.git
cd libv8
bundle install
bundle exec rake clean build binary
gem install pkg/libv8-3.16.14.3-x86_64-darwin-12.gem #note that libv8 version may change, so tab through files in pkg/, also remember to use the one with version specified

그런 다음 프로젝트 보석을 번들로 묶으십시오.

이것이 10.10 (루비 2.1.2)에서 저에게 효과가 있었던 유일한 방법입니다.


답변

gem uninstall libv8
brew install v8
gem install therubyracer
gem install libv8 -v '3.16.14.3' -- --with-system-v8

이것이 10.10 (루비 2.1.2)에서 저에게 효과가 있었던 유일한 방법입니다.

또는 gem install libv8 -v 'XX.XX.XX' -- --with-system-v8gem의 버전을 추가 해보세요. 🙂

Mac OS Catalina 업데이트 :

brew tap homebrew/versions
brew install v8@3.15
brew link --force v8@3.15
gem install libv8 -v 'XX.XX.XX' -- --with-system-v8
gem install therubyracer


답변

이번에는 어떤 답변도 저에게 효과가 없습니다. 나는 이것을 너무 사용했다.

brew tap homebrew/versions
brew install v8-315

gem install libv8 -v '3.16.14.13' -- --with-system-v8
gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8-315

bundle install

rubyracer Github 문제에서 확인되었습니다.

다른 사람에게 도움이되기를 바랍니다.


답변

누군가에게 유용 할 수도 있지만 libv8의 문제로 인해 Rubyracer를 설치하는 데 문제가있었습니다. 해결책은 내가 설치 한 모든 libv8 을 제거 하는 것이 었습니다. Rubyracer 설치

$ gem uninstall libv8
$ gem install therubyracer -v '0.12.0'
Fetching: libv8-3.16.14.7-x86_64-darwin-14.gem ( 57%)
Fetching: libv8-3.16.14.7-x86_64-darwin-14.gem (100%)
Successfully installed libv8-3.16.14.7-x86_64-darwin-14
Building native extensions.  This could take a while...
Successfully installed therubyracer-0.12.0
2 gems installed

누군가에게 도움이되기를 바랍니다.


답변

이것이 업스트림에서 수정 된 것 같습니다. 저와 @aurels, @Mike Causer 및 @Juanda에게 효과가 있었던 것은 다음과 같습니다.

bundle update libv8


답변

이것은 Yosemite와 Ruby 2.1.5 (Ruby through RVM)에서 매우 잘 작동했습니다.

gem install libv8 -v '3.16.14.3' -- --with-system-v8

이전에는 Gem::Ext::BuildError: ERROR: Failed to build gem native extension.libv8 gem 버전 3.16.14.3에 오류가 발생 했습니다.


답변

내 Yosemite, Ruby 2.1.2에서만이 기능이 작동합니다.

gem install libv8 -v '3.16.14.3' -- --with-system-v8
brew link --overwrite v8-315 --force
gem install therubyracer -v '0.12.2' -- --with-system-v8