Mavericks에 다음 gem 버전을 설치하려고합니다.
- libv8 (3.16.14.3)
 - therubyracer (0.12.1)
 
분명히 therubyracer gem은 libv8에 의존합니다.
1) libv8 설치
libv8은 무엇입니까? 내 약간의 연구가 Google 크롬에서 사용하는 일종의 자바 스크립트 라이브러리임을 암시하는 것 같습니다.
설치하는 데 문제가 있었지만 이 훌륭한 게시물 에는 내 오류와 우회 방법에 대한 잘 설명 된 답변이 모두 포함되어 있습니다.
그래서 설치 libv8와 함께
gem install libv8 -- --with-system-v8
이것은 gem을 설치하지만 gem과 함께 제공되는 버전 대신 v8 라이브러리의 로컬 시스템 설치를 사용한다는 것을 이해합니다. 어느 쪽이든 성공했습니다.
2) Rubyracer 설치
다음 단계에서 therubyracergem을 설치하는 데 문제가있었습니다 . 이 gem이 무엇을하는지 잘 모르겠습니다. 단지 제가하려는 rails 프로젝트의 의존성 일뿐입니다 bundle install.
다음과 같은 오류가 발생합니다.
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
    /Users/jeeves.butler/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb
checking for main() in -lpthread... yes
checking for main() in -lobjc... yes
checking for v8.h... no
*** 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
    --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=/Users/jeeves.butler/.rvm/rubies/ruby-1.9.2-p290/bin/ruby
    --with-pthreadlib
    --without-pthreadlib
    --with-objclib
    --without-objclib
    --enable-debug
    --disable-debug
    --with-v8-dir
    --without-v8-dir
    --with-v8-include
    --without-v8-include=${v8-dir}/include
    --with-v8-lib
    --without-v8-lib=${v8-dir}/lib
/Users/jeeves.butler/.rvm/gems/ruby-1.9.2-p290/gems/libv8-3.16.14.3/ext/libv8/location.rb:50:in
'configure': You have chosen to use the version of V8 found
on your system (Libv8::Location::System::NotFoundError)
and *not* the one that is bundled with the libv8 rubygem. However,
it could not be located. please make sure you have a version of
v8 that is compatible with 3.16.14.3 installed. You may
need to special --with-v8-dir options if it is in a non-standard
location
thanks,
The Mgmt
    from /Users/jeeves.butler/.rvm/gems/ruby-1.9.2-p290/gems/libv8-3.16.14.3/lib/libv8.rb:7:in `configure_makefile'
    from extconf.rb:32:in `<main>'
extconf failed, exit code 1
Gem files will remain installed in /Users/jeeves.butler/.rvm/gems/ruby-1.9.2-p290/gems/therubyracer-0.12.1 for inspection.
Results logged to /Users/jeeves.butler/.rvm/gems/ruby-1.9.2-p290/extensions/x86_64-darwin-13/1.9.1/therubyracer-0.12.1/gem_make.out
내가 수집 할 수있는 libv8내용에서에서 제공하는 것 대신 로컬 V8 라이브러리를 사용하여 설치하기로 선택 libv8했지만 이제는 로컬 설치를 찾을 수 없습니다.
- V8이 실제로 설치되어 있는지 어떻게 확인하고 어떻게 찾습니까?
 - 지정된 플래그 중 몇 개를 시도했지만 어느 것도 gem이 올바른 설치 디렉토리를 가리키는 것 같지 않았습니다.
 - 이것은 별도의 주제 일 수 있지만 무엇 
extconf.rb입니까? 나는 그것을 몇 군데에서 보았다. 그리고gcc구체적으로 컴파일러로 무엇을하려고 합니까? 
감사!!
편집하다:
답변
이 단계는 저에게 효과적이었습니다.
운영체제 : Maverick Ruby : 2.1.1
gem uninstall libv8
gem install therubyracer -v '0.11.3'
gem install libv8 -v '3.11.8.13' -- --with-system-v8
답변
OS X El Capitan에서이 문제에 직면 한 사람들 에게 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
나는 또한 brew install gcc이전에 실행 했지만 이것이 실제로 필요한지 확실하지 않습니다.
답변
먼저 libv8 gem을 제거한 다음 rubyracer를 설치 한 다음 libv8을 설치하십시오.
gem uninstall libv8
gem install therubyracer
gem install libv8 -- --with-system-v8
답변
github에 게시 된 Tertom의 솔루션 은 각 github 문제 와 여기 에 제안 된 다른 모든 솔루션을 시도한 후 나를 위해 해결했습니다 . 
나는 똑같은 시스템 구성을 가졌습니다. 
이것은 el capitan에 대한 것이므로 질문에 대한 정확한 답은 아니지만 사람들은이 정보가 도움이 될 수 있습니다.
가시성을 위해 여기에서 인용하고 있습니다.
같은 문제를 해결
- MacOS 10.11.2
 - 루비 1.9.3
 - libv8 3.16.14.13
 - therubyracer 0.12.2
 –
brew tap homebrew/versions brew install v8-315 brew link --force v8-315 bundle install brew unlink v8-315libv8도 설치할 수없는 경우
gem install libv8 --with-system-v8또는
bundle config build.libv8 --with-system-v8
답변
macOS 10.15를 사용하는 모든 사람들을 위해 brew가 변경되었으므로 이러한 명령을 수행해야합니다.
brew install v8@3.15
gem install libv8 -v 'YOUR_VERSION' -- --with-system-v8
gem install therubyracer -v 'YOUR_VERSION' -- --with-v8-dir=/usr/local/opt/v8@3.15
bundle install
답변
위의 답변은 저에게 효과적이지 않았습니다. 내 번 들러 구성 이 disable-shared-gems활성화되어 추가 문제가 발생합니다.
Yosemite 10.10.1, Rails 3.2.x 및 Ruby 1.9.3p550을 사용하고 있습니다.
내 다음 스 니펫 bin/setup이 문제를 해결했습니다.
if ! bundle show therubyracer; then
    bundle config build.libv8 --with-system-v8
    gem install --install-dir vendor/bundle libv8 -v 3.16.14.7
    gem install libv8 -v 3.16.14.7
    gem install --install-dir vendor/bundle therubyracer 
fi
답변
위의 문제에 대한 해결 방법을 찾았습니다.
이것은 libv8과 therubyracer 간의 호환성에 가깝습니다.
gem install libv8 -v '3.3.10.4' -- --with-system-v8
gem install therubyracer -v '0.10.2'
두 버전이 모두 저와 호환되므로 잘 작동합니다. 처음에는 therubyracer에 0.12.0 버전을 설치하려고했는데 문제가 발생했습니다. 0.10.2 버전으로 전환하면 모든 것이 잘 작동했습니다.
내 현재 OS : Mavericks
