Błąd instalacji libv8: błąd: nie udało się zbudować natywnego rozszerzenia gem

I made a rails project with,

rails new test_bootstrap.

Udało się.

Przeniesiono do katalogu projektu i dodano klejnoty

gem "therubyracer"
gem "less-rails" #Sprockets (what Rails 3.1 uses for its asset pipeline) supports LESS
gem "twitter-bootstrap-rails"

I uruchomić

bundle install

Po tym, mam ten błąd.

Installing libv8 (3.16.14.3)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

c:/RailsInstaller/Ruby1.9.3/bin/ruby.exe extconf.rb
creating Makefile
지정된 경로를 찾을 수 없습니다.                                                          지정된 경로를 찾을 수
없습니다.                                                          지정된 경로를 찾을 수 없습니다.

c:/RailsInstaller/Ruby1.9.3/lib/ruby/ge
ms/1.9.1/gems/libv8-3.16.14.3/ext/libv8/builder.rb:58:in `setup_python!': libv8 requires
python 2 to be installed in order to build, but it is currently not available (RuntimeErr
or) from c:/RailsInstaller/Ruby1.9.
3/lib/ruby/gems/1.9.1/gems/libv8-3.16.14.3/ext/libv8/builder.rb:42:in `block in build_lib
v8/builder.rb:42:in `block in build_libv8!'
        from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/libv8-3.16.14.3/ext/lib
v8/builder.rb:40:in `chdir'
        from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/libv8-3.16.14.3/ext/lib
v8/builder.rb:40:in `build_libv8!'
        from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/libv8-3.16.14.3/ext/lib
v8/location.rb:24:in `install!'
        from extconf.rb:7:in `<main>'                                                    


Gem files will remain installed in c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/l
ibv8-3.16.14.3 for inspection.
Results logged to c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/libv8-3.16.14.3/ex
t/libv8/gem_make.out
An error occurred while installing libv8 (3.16.14.3), and Bundler cannot
continue.
Make sure that `gem install libv8 -v '3.16.14.3'` succeeds before bundling.
Przepraszam za Koreańczyków. Mówi, że nie może znaleźć wybranej ścieżki czy coś w tym stylu.

I próbowałem uruchomić to polecenie

gem install libv8 -v '3.16.14.3' 

Rzucanie tego samego błędu.

Author: jww, 2013-10-30

18 answers

Spróbuj tego:

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

Uwaga: ponieważ libv8 jest interfejsem dla silnika V8 używanego przez therubyracer, może być konieczne użycie libv8, nawet jeśli masz już zainstalowaną wersję V8. Jeśli chcesz użyć własnej instalacji V8, a nie mieć ją zbudowaną dla ciebie użyj opcji --with-system-v8.

Więcej informacji można znaleźć w dokumentacji libv8 na GitHubie
 620
Author: Gopal S Rathore,
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-20 21:28:16

Jak rozwiązać problem libv8 / therubyracer

Napotkałem podobny problem, w którym po zainstalowaniu libv8 pojawia się błąd instalacji therubyracera. Oto moje rozwiązanie:

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

-- Zobacz błąd instalowania therubyracera --

$ gem uninstall libv8

$ brew install v8

$ gem install therubyracer

$ bundle install

-- Zobacz błąd instalacji libv8 --

$ gem install libv8 -v '3.16.14.3' -- --with-system-v8
 156
Author: Arpit Shah,
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
2020-06-20 09:12:55

Z homebrew to pomaga mi rozwiązać ten błąd.

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

Widziane w rubyracer Github problemy.

 49
Author: coding addicted,
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-03 17:00:57

Wypróbowałem rozwiązanie wymienione powyżej polecenia, które wygląda bardzo dobrze dla instalacji poszczególnych gem, ale dla użytkowników bundler-powinieneś użyć Bundle config

Użyj

bundle config build.libv8 --with-system-v8 

I

bundle config build.therubyracer --with-system-v8

Aby skonfigurować bundler tak, aby pobierał parametry używane podczas instalacji konkretnego gem

 48
Author: Anand Chavan,
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-14 14:15:35

Myślę, że nie potrzebujesz therubyracer klejnotu na windows. Jest to środowisko uruchomieniowe javascript wykorzystujące silnik V8. Dlatego podejmuje próbę instalacji libv8.

Możesz bezpiecznie usunąć klejnot ze swojego pliku Gemfile.

Rails chętnie korzysta z tego, które środowisko uruchomieniowe może znaleźć. execjs,nodejs itd. są wszystkie możliwe opcje.

Microsoft osadza już środowisko uruchomieniowe JScript dla javascript w systemie windows, a Rails go używa. Zobacz więcej

 7
Author: Litmus,
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-05-23 11:47:25

Innym obejściem problemu jest oddzielenie ich w Gemfile

group :production do
 gem 'libv8', '~> 3.11.8.3'
 gem 'therubyracer', :platform => :ruby
end

A następnie uruchom polecenie bundle: bundle install --without production

 6
Author: Arman Ortega,
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-03-22 15:32:46

Nie mogłem też zainstalować tego klejnotu zamiast używać

--with-system-v8

Raz spróbuj zrobić bundle update które działało dobrze dla mnie

 3
Author: Rishav Bhardwaj,
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-07-20 16:40:26

Znalazłem to na github

Zakładając, że wypróbowałeś powyższe kroki, zainstaluj v8-315 i v8 przez brew.

brew unlink v8
brew link --force v8-315
gem install therubyracer -v '0.12.2' -- --with-system-v8
 3
Author: Sojan Jose,
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
2019-09-14 10:45:03

To mi pasuje. Put that in your Gemfile

Gem 'libv8', '~>3.16.14.7'

 2
Author: Hrk,
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-01-12 15:11:42

Mój problem nie był związany z therubyracer w ogóle tylko libv8 gem i jak @ rishav-bhardwaj wskazał --with-system-v8 nie zrobił sztuczki, zamiast tego musiałem exec

bundle update

Then

bundle install

I wreszcie

Bundle complete!

Błąd zniknął!

Gem::Ext::BuildError: ERROR: Failed to build gem native extension. An error occurred while installing libv8 (3.16.14.7), and Bundler cannot continue. Make sure that `gem install libv8 -v '3.16.14.7'` succeeds before bundling.

 1
Author: d1jhoni1b,
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-03-17 17:15:40

W moim przypadku rozwiązałem tę sytuację wymagając 'mini_racer', '~> 0.2.6' in my Gemfile

Wtedy zadziałało polecenie bundle install.

 1
Author: Tomas Radic,
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
2019-12-26 18:00:44

Spróbuj z

Gem "therubyracer", "~ > 0.10.2 " do Gemfile

I zainstaluje zależny Gem libv8 (3.3.10.4) i problem build Gem native extension failure został rozwiązany.

 0
Author: rahul patil,
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-07 05:30:34

Rozwiązano problem libv8 3.16.14.7 używając poniższego polecenia:

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

A następnie bundle install pomyślnie zakończone.

 0
Author: Faisal Raza,
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-07-28 12:42:33

Wydaje mi się, że ma to mniej wspólnego z libv8, a Więcej z therubyracerem.

Otrzymałem ten sam błąd podczas uruchamiania instalacji pakietu na aplikacji rails. jeśli napotkałeś to w podobny sposób, spróbuj zainstalować gem poza pakietem w ten sposób:

gem install therubyracer

Następnie uruchom pakiet install. mam nadzieję, że to też zadziała.

 0
Author: Sean M,
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-07-28 14:28:41

Miałem też problemy z używaniem libv8 i mini_racer. Rozwiązano problem z

brew install v8

bundle update libv8 mini_racer

Używanie najnowszych wersji mini_racer 0.2.10 i libv8 7.3.492.27 działało jak czar.

 0
Author: anka,
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
2020-05-10 18:15:24

Próbowałem poniższych poleceń na moim lokalnym, działało dobrze:

brew install [email protected]
gem install libv8 -v 'YOUR_VERSION' -- --with-system-v8
gem install therubyracer -v 'YOUR_VERSION' -- --with-v8-dir=/usr/local/opt/[email protected]
bundle install
 0
Author: Rintu George,
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
2020-06-23 22:32:42

W grudniu 2020 r.na maszynach wirtualnych Debian 10 oraz na naszych lokalnych pulpitach Debian 10 pojawił się błąd kompilacji.

Bundle nie próbuje skompilować Installing libv8 3.16.14.19 with native extensions

Dziennik błędów mówi:

IOError: [Errno 2] No such file or directory: '/home/username/application/shared/bundle/ruby/2.6.0/gems/libv8-7.3.492.27.1/vendor/build/config/gclient_args.gni'
Running: gclient root
Running: gclient config --spec 'solutions = [
  {
    "url": "https://chromium.googlesource.com/v8/v8.git",
    "managed": False,
    "name": "v8",
    "deps_file": "DEPS",
    "custom_deps": {},
  },
]
'
Running: gclient sync --with_branch_heads
Subprocess failed with return code 1.

Sprawdziliśmy tagi w Google V8 Repo i okazało się, że żądany tag 7.3.492.27.1 wydaje się nie być dostępny w Repo Google:

libv8 did not install properly, expected binary v8 archive '/home/.../gyp
/libv8_snapshot.a'to exist, but it was not found 
(Libv8::Location::Vendor::ArchiveNotFound)

Naszym jedynym rozwiązaniem było całkowite usunięcietherubyracer z Gemfile:- (

 0
Author: Tim Brandes,
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
2020-12-11 09:10:28

Rozwiązałem ten problem używając:

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

 0
Author: davidauza.engineer,
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
2021-01-07 16:10:20