therubyracer-Gem::Ext::BuildError: ERROR: Failed to build Gem native extension
[14]} próbuję zainstalować następujące wersje gem na Mavericks
- libv8 (3.16.14.3)
- therubyracer (0.12.1)
Oczywiście perełki therubyracera zależą od libv8.
1) Instalacja libv8
Czym jest libv8? Moje badania wydają się wskazywać, że jest to jakaś biblioteka javascript używana przez Google Chrome?
Miałem problem z zainstalowaniem go, ale ten świetny post miał zarówno mój błąd, jak i dobrze wyjaśnioną odpowiedź na jak go ominąć.
Więc zainstalowałem libv8
z
gem install libv8 -- --with-system-v8
Rozumiem, że instaluje gem, ale zamiast tego używa mojej lokalnej instalacji systemu biblioteki v8... wersja z klejnotem? Tak czy siak, udało się.
2) Instalowanie therubyracera
Podczas następnego kroku miałem problem z instalacją therubyracer
gem. Nie jestem do końca pewien, co robi ten klejnot, tylko że jest to zależność od projektu rails, który próbuję bundle install
.
It daje mi następujący błąd:
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
Z tego, co udało mi się zebrać, zdecydowałem się zainstalować libv8
używając mojej lokalnej biblioteki V8 zamiast tego, co zostało dostarczone z libv8
, ale teraz nie można zlokalizować lokalnej instalacji.
- Jak sprawdzić, czy rzeczywiście mam zainstalowaną wersję V8 i jak ją zlokalizować?
- próbowałem kilku podanych FLAG, żadna z nich nie wskazywała klejnotu na poprawny katalog instalacji
- to może być osobny temat, ale co jest
extconf.rb
? Widziałem to w kilku miejscach. A co to ma wspólnego ze kompilatoremgcc
w specyfice?
Dzięki!!
EDIT:
Próbowałem tego rozwiązania odinstalowania libv8 i ponownej instalacji przez
brew install
. Wspomniano o tym również w kilku podobnych pytaniach. Bez powodzenia.Próbowałem też
CC
,CXX
, iCPP
zmienne środowiskowe opisane tutaj , chociaż nie sądzę, że ma to jakiekolwiek efekt jak już odbierał mój kompilatorgcc v4.6
.
9 answers
Ten krok zadziałał dla mnie.
OS: 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
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2014-09-04 07:40:54
Dla tych, którzy borykają się z tym problemem w OS X El Capitan, To rozwiązanie z wątku problem therubyracer było tym, co w końcu zadziałało dla mnie:
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
Ja też biegałem brew install gcc
wcześniej, ale nie jestem pewien, czy to było rzeczywiście konieczne.
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2016-03-28 21:33:15
Spróbuj najpierw odinstalować libv8 gem, a następnie zainstalować rubyracer, a następnie libv8
gem uninstall libv8
gem install therubyracer
gem install libv8 -- --with-system-v8
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2016-04-25 12:51:47
Rozwiązanie Tertom opublikowane na GitHubie rozwiązało je dla mnie, po wypróbowaniu wszystkich innych rozwiązań zaproponowanych w odpowiednim wydaniu github i tutaj.
Miałem dokładnie taką samą konfigurację systemu.
To jest na El capitan, więc nie dokładna odpowiedź na pytanie, ale ludzie mogą znaleźć te informacje pomocne.
Cytuję to tutaj dla widoczności:
Rozwiązałem ten sam problem
- MacOS 10.11.2
- ruby 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-315
Jeśli nie możesz również zainstalować libv8,
gem install libv8 --with-system-v8
Lub
bundle config build.libv8 --with-system-v8
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2016-01-22 22:02:38
Powyższe odpowiedzi nie działają dla mnie; mój konfigurator bundler ma włączone disable-shared-gems
, co powoduje dodatkowe problemy.
Używam Yosemite 10.10.1, Rails 3.2.x, oraz Ruby 1.9.3p550.
Następujący fragment w moim bin/setup
naprawił problem dla mnie.
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
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2014-12-18 12:00:29
Znalazłem obejście powyższego problemu.
Jest to bardziej kompatybilność pomiędzy libv8 i therubyracer.
gem install libv8 -v '3.3.10.4' -- --with-system-v8
gem install therubyracer -v '0.10.2'
To powinno działać dobrze, ponieważ obie wersje są kompatybilne ze mną. Początkowo próbowałem zainstalować wersję 0.12.0 dla therubyracer i borykał się z problemem. Po przejściu na wersję 0.10.2 wszystko działało dobrze.
Mój obecny OS: Mavericks
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2014-08-26 07:09:00
Po złamaniu mi głowy przez prawie dwa dni to zadziałało.
rvm install 2.2.2
gem install rails
bundle install
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2015-10-09 18:34:17
Zauważyłem, że gdy napotkamy problem:
Gem::Ext::BuildError: ERROR: Failed to build gem native extension
Następnie należy zainstalować build-essential
sudo apt install build-essential
U mnie działa z problemami z instalacją mini_race.
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2017-08-24 18:20:41
Właśnie uruchomiłem bundle update i zadziałało na mnie.
Obs.: Using Ruby 2.3.0
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2016-05-10 00:21:29