簡體   English   中英

安裝 libv8 (8.4.255.0) 時出錯

[英]An error occurred while installing libv8 (8.4.255.0)

我已經為這個錯誤苦苦掙扎了很長一段時間,希望有人能提供幫助。 這是我在運行bundle時遇到的錯誤。

    Fetching libv8 8.4.255.0
Installing libv8 8.4.255.0 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /Users/buddha/.gem/ruby/2.6.0/gems/libv8-8.4.255.0/ext/libv8
/Users/buddha/.rbenv/versions/2.7.2/bin/ruby -I /Users/buddha/.rbenv/versions/2.7.2/lib/ruby/2.7.0 -r
./siteconf20220813-30612-hzinfo.rb extconf.rb --with-system-v8
creating Makefile
WARNING: Your metrics.cfg file was invalid or nonexistent. A new one will be created.

________ running 'arch -arch arm64 git -c core.deltaBaseCacheLimit=2g clone --no-checkout --progress
https://chromium.googlesource.com/v8/v8.git /Users/buddha/.gem/ruby/2.6.0/gems/libv8-8.4.255.0/vendor/_gclient_v8_wtvu8iij' in
'/Users/buddha/.gem/ruby/2.6.0/gems/libv8-8.4.255.0/vendor'
arch: posix_spawnp: git: Bad CPU type in executable
1>WARNING: subprocess '"arch" "-arch" "arm64" "git" "-c" "core.deltaBaseCacheLimit=2g" "clone" "--no-checkout" "--progress"
"https://chromium.googlesource.com/v8/v8.git" "/Users/buddha/.gem/ruby/2.6.0/gems/libv8-8.4.255.0/vendor/_gclient_v8_wtvu8iij"'
in /Users/buddha/.gem/ruby/2.6.0/gems/libv8-8.4.255.0/vendor failed; will retry after a short nap...

________ running 'arch -arch arm64 git -c core.deltaBaseCacheLimit=2g clone --no-checkout --progress
https://chromium.googlesource.com/v8/v8.git /Users/buddha/.gem/ruby/2.6.0/gems/libv8-8.4.255.0/vendor/_gclient_v8_wtvu8iij' in
'/Users/buddha/.gem/ruby/2.6.0/gems/libv8-8.4.255.0/vendor' attempt 2 / 4
arch: posix_spawnp: git: Bad CPU type in executable
1>WARNING: subprocess '"arch" "-arch" "arm64" "git" "-c" "core.deltaBaseCacheLimit=2g" "clone" "--no-checkout" "--progress"
"https://chromium.googlesource.com/v8/v8.git" "/Users/buddha/.gem/ruby/2.6.0/gems/libv8-8.4.255.0/vendor/_gclient_v8_wtvu8iij"'
in /Users/buddha/.gem/ruby/2.6.0/gems/libv8-8.4.255.0/vendor failed; will retry after a short nap...

________ running 'arch -arch arm64 git -c core.deltaBaseCacheLimit=2g clone --no-checkout --progress
https://chromium.googlesource.com/v8/v8.git /Users/buddha/.gem/ruby/2.6.0/gems/libv8-8.4.255.0/vendor/_gclient_v8_wtvu8iij' in
'/Users/buddha/.gem/ruby/2.6.0/gems/libv8-8.4.255.0/vendor' attempt 3 / 4
arch: posix_spawnp: git: Bad CPU type in executable
1>WARNING: subprocess '"arch" "-arch" "arm64" "git" "-c" "core.deltaBaseCacheLimit=2g" "clone" "--no-checkout" "--progress"
"https://chromium.googlesource.com/v8/v8.git" "/Users/buddha/.gem/ruby/2.6.0/gems/libv8-8.4.255.0/vendor/_gclient_v8_wtvu8iij"'
in /Users/buddha/.gem/ruby/2.6.0/gems/libv8-8.4.255.0/vendor failed; will retry after a short nap...

________ running 'arch -arch arm64 git -c core.deltaBaseCacheLimit=2g clone --no-checkout --progress
https://chromium.googlesource.com/v8/v8.git /Users/buddha/.gem/ruby/2.6.0/gems/libv8-8.4.255.0/vendor/_gclient_v8_wtvu8iij' in
'/Users/buddha/.gem/ruby/2.6.0/gems/libv8-8.4.255.0/vendor' attempt 4 / 4
arch: posix_spawnp: git: Bad CPU type in executable
1>WARNING: subprocess '"arch" "-arch" "arm64" "git" "-c" "core.deltaBaseCacheLimit=2g" "clone" "--no-checkout" "--progress"
"https://chromium.googlesource.com/v8/v8.git" "/Users/buddha/.gem/ruby/2.6.0/gems/libv8-8.4.255.0/vendor/_gclient_v8_wtvu8iij"'
in /Users/buddha/.gem/ruby/2.6.0/gems/libv8-8.4.255.0/vendor failed; will retry after a short nap...

v8 (ERROR)
----------------------------------------
[0:00:00] Started.
[0:00:00] 
Traceback (most recent call last):
  File "/Users/buddha/.gem/ruby/2.6.0/gems/libv8-8.4.255.0/vendor/depot_tools/gclient_scm.py", line 1041, in _Clone
    self._Run(clone_cmd, options, cwd=self._root_dir, retry=True,
  File "/Users/buddha/.gem/ruby/2.6.0/gems/libv8-8.4.255.0/vendor/depot_tools/gclient_scm.py", line 1401, in _Run
    gclient_utils.CheckCallAndFilter(cmd, env=env, **kwargs)
  File "/Users/buddha/.gem/ruby/2.6.0/gems/libv8-8.4.255.0/vendor/depot_tools/gclient_utils.py", line 654, in CheckCallAndFilter
    raise subprocess2.CalledProcessError(
subprocess2.CalledProcessError: Command 'arch -arch arm64 git -c core.deltaBaseCacheLimit=2g clone --no-checkout --progress
https://chromium.googlesource.com/v8/v8.git /Users/buddha/.gem/ruby/2.6.0/gems/libv8-8.4.255.0/vendor/_gclient_v8_wtvu8iij'
returned non-zero exit status 1 in /Users/buddha/.gem/ruby/2.6.0/gems/libv8-8.4.255.0/vendor
[0:00:07] _____ Conflicting directory found in /Users/buddha/.gem/ruby/2.6.0/gems/libv8-8.4.255.0/vendor/v8. Moving to
/Users/buddha/.gem/ruby/2.6.0/gems/libv8-8.4.255.0/vendor/_bad_scm/v8rteogvxs.
----------------------------------------


Warnings:
Conflicting directory /Users/buddha/.gem/ruby/2.6.0/gems/libv8-8.4.255.0/vendor/v8 moved to
/Users/buddha/.gem/ruby/2.6.0/gems/libv8-8.4.255.0/vendor/_bad_scm/v8rteogvxs.
Traceback (most recent call last):
  File "/Users/buddha/.gem/ruby/2.6.0/gems/libv8-8.4.255.0/vendor/depot_tools/gclient_scm.py", line 545, in update
    self._Clone(revision, url, options)
  File "/Users/buddha/.gem/ruby/2.6.0/gems/libv8-8.4.255.0/vendor/depot_tools/gclient_scm.py", line 1041, in _Clone
    self._Run(clone_cmd, options, cwd=self._root_dir, retry=True,
  File "/Users/buddha/.gem/ruby/2.6.0/gems/libv8-8.4.255.0/vendor/depot_tools/gclient_scm.py", line 1401, in _Run
    gclient_utils.CheckCallAndFilter(cmd, env=env, **kwargs)
  File "/Users/buddha/.gem/ruby/2.6.0/gems/libv8-8.4.255.0/vendor/depot_tools/gclient_utils.py", line 654, in CheckCallAndFilter
    raise subprocess2.CalledProcessError(
subprocess2.CalledProcessError: Command 'arch -arch arm64 git -c core.deltaBaseCacheLimit=2g clone --no-checkout --progress
https://chromium.googlesource.com/v8/v8.git /Users/buddha/.gem/ruby/2.6.0/gems/libv8-8.4.255.0/vendor/_gclient_v8_wtvu8iij'
returned non-zero exit status 1 in /Users/buddha/.gem/ruby/2.6.0/gems/libv8-8.4.255.0/vendor

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/buddha/.vpython-root/54d2e4/lib/python3.8/shutil.py", line 780, in move
    os.rename(src, real_dst)
FileNotFoundError: [Errno 2] No such file or directory: '/Users/buddha/.gem/ruby/2.6.0/gems/libv8-8.4.255.0/vendor/v8' ->
'/Users/buddha/.gem/ruby/2.6.0/gems/libv8-8.4.255.0/vendor/_bad_scm/v8rteogvxs/v8'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/buddha/.gem/ruby/2.6.0/gems/libv8-8.4.255.0/vendor/depot_tools/metrics.py", line 267, in print_notice_and_exit
    yield
  File "/Users/buddha/.gem/ruby/2.6.0/gems/libv8-8.4.255.0/vendor/depot_tools/gclient.py", line 3196, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/Users/buddha/.gem/ruby/2.6.0/gems/libv8-8.4.255.0/vendor/depot_tools/gclient.py", line 3182, in main
    return dispatcher.execute(OptionParser(), argv)
  File "/Users/buddha/.gem/ruby/2.6.0/gems/libv8-8.4.255.0/vendor/depot_tools/subcommand.py", line 252, in execute
    return command(parser, args[1:])
  File "/Users/buddha/.gem/ruby/2.6.0/gems/libv8-8.4.255.0/vendor/depot_tools/gclient.py", line 2738, in CMDsync
    ret = client.RunOnDeps('update', args)
  File "/Users/buddha/.gem/ruby/2.6.0/gems/libv8-8.4.255.0/vendor/depot_tools/gclient.py", line 1780, in RunOnDeps
    work_queue.flush(revision_overrides, command, args, options=self._options,
  File "/Users/buddha/.gem/ruby/2.6.0/gems/libv8-8.4.255.0/vendor/depot_tools/gclient_utils.py", line 947, in flush
    reraise(e[0], e[1], e[2])
  File "/Users/buddha/.gem/ruby/2.6.0/gems/libv8-8.4.255.0/vendor/depot_tools/gclient_utils.py", line 66, in reraise
    raise value
  File "/Users/buddha/.gem/ruby/2.6.0/gems/libv8-8.4.255.0/vendor/depot_tools/gclient_utils.py", line 1024, in run
    self.item.run(*self.args, **self.kwargs)
  File "/Users/buddha/.gem/ruby/2.6.0/gems/libv8-8.4.255.0/vendor/depot_tools/gclient.py", line 926, in run
    self._got_revision = self._used_scm.RunCommand(command, options, args,
  File "/Users/buddha/.gem/ruby/2.6.0/gems/libv8-8.4.255.0/vendor/depot_tools/gclient_scm.py", line 132, in RunCommand
    return getattr(self, command)(options, args, file_list)
  File "/Users/buddha/.gem/ruby/2.6.0/gems/libv8-8.4.255.0/vendor/depot_tools/gclient_scm.py", line 547, in update
    self._DeleteOrMove(options.force)
  File "/Users/buddha/.gem/ruby/2.6.0/gems/libv8-8.4.255.0/vendor/depot_tools/gclient_scm.py", line 207, in _DeleteOrMove
    shutil.move(self.checkout_path, dest_path)
  File "/Users/buddha/.vpython-root/54d2e4/lib/python3.8/shutil.py", line 794, in move
    copy_function(src, real_dst)
  File "/Users/buddha/.vpython-root/54d2e4/lib/python3.8/shutil.py", line 426, in copy2
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/Users/buddha/.vpython-root/54d2e4/lib/python3.8/shutil.py", line 259, in copyfile
    with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:
FileNotFoundError: [Errno 2] No such file or directory: '/Users/buddha/.gem/ruby/2.6.0/gems/libv8-8.4.255.0/vendor/v8'
Running: gclient root
Running: gclient config --spec 'solutions = [
  {
    "name": "v8",
    "url": "https://chromium.googlesource.com/v8/v8.git",
    "deps_file": "DEPS",
    "managed": False,
    "custom_deps": {},
  },
]
'
Running: gclient sync --with_branch_heads
Subprocess failed with return code 1.
/Users/buddha/.gem/ruby/2.6.0/gems/libv8-8.4.255.0/ext/libv8/builder.rb:83:in `block in setup_build_deps!': unable to fetch v8
source (RuntimeError)
    from /Users/buddha/.gem/ruby/2.6.0/gems/libv8-8.4.255.0/ext/libv8/builder.rb:81:in `chdir'
    from /Users/buddha/.gem/ruby/2.6.0/gems/libv8-8.4.255.0/ext/libv8/builder.rb:81:in `setup_build_deps!'
    from /Users/buddha/.gem/ruby/2.6.0/gems/libv8-8.4.255.0/ext/libv8/builder.rb:40:in `build_libv8!'
    from /Users/buddha/.gem/ruby/2.6.0/gems/libv8-8.4.255.0/ext/libv8/location.rb:24:in `install!'
    from extconf.rb:7:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in /Users/buddha/.gem/ruby/2.6.0/gems/libv8-8.4.255.0 for inspection.
Results logged to /Users/buddha/.gem/ruby/2.6.0/extensions/x86_64-darwin-21/2.7.0/libv8-8.4.255.0/gem_make.out

An error occurred while installing libv8 (8.4.255.0), and Bundler cannot continue.
Make sure that `gem install libv8 -v '8.4.255.0' --source 'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
  mini_racer was resolved to 0.3.1, which depends on
    libv8

這是我的 Gemfile:

source 'https://rubygems.org'

git_source(:github) do |repo_name|
  repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
  "https://github.com/#{repo_name}.git"
end

gem 'bitfields', "~> 0.8.0"
gem 'bootstrap', '~> 4.0.0.beta'
gem 'braintree', "~> 2.70.0"
gem 'ckeditor', "~> 4.2.4"
gem 'coffee-rails', '~> 4.2.2'
gem 'devise', "~> 4.6.2"
gem 'devise_masquerade', "~> 0.6.5"
gem 'dragonfly', "~> 1.1.3"
gem 'dragonfly-s3_data_store', "~> 1.3.0"
gem 'exception_notification', "~> 4.2.2"
gem 'execjs', "~> 2.7.0"
gem 'figaro', "~> 1.1.1"
gem 'icalendar', "~> 2.4.1"
gem 'jbuilder', '~> 2.7.0'
gem 'jquery-rails', "~> 4.3.1"
gem 'listen', '~> 3.0.8'
gem 'mandrill_dm'
gem 'meta-tags', "~> 2.6.0"
gem 'mysql2', "~> 0.4.9"
gem 'omniauth-facebook', "~> 5.0.0"
gem 'omniauth-google-oauth2', "~> 0.5.2"
gem 'phony', "~> 2.15.48"
gem 'popper_js', "~> 1.11.1"
gem 'pundit', "~> 1.1.0"
gem 'rails', '~> 5.0.6'
gem 'rails_engine_decorators', git: 'https://github.com/HelloThisIsMartha/rails_engine_decorators'
gem 'react-rails', "~> 2.4.7"
gem 'redis-rails', "~> 5.0.2"
gem 'request_store', "~> 1.3.2"
gem 'rinku', "~> 2.0.3"
gem 'roman-numerals', "~> 0.3.0"
gem 'sass-rails', '~> 5.0.6'
gem 'sidekiq', "~> 5.0.4"
gem 'textris', "~> 0.4.4"
gem 'mini_racer', "~> 0.3.0"
gem 'thredded', '~> 0.9.4'
gem "timecop", "~> 0.9.4"
gem 'twilio-ruby', "~> 5.2.3"
gem 'uglifier', '~> 3.2.0'
gem 'websocket-driver', "~> 0.6.5"
gem 'whenever', "~> 0.9.7", :require => false

# Boostrap 4 alpha requires assets tether
source 'https://rails-assets.org' do
  gem 'rails-assets-tether', '~> 1.4.0'
end

group :staging, :production, :devasprod do
  gem 'puma', '~> 3.12.6'
  gem 'puma_worker_killer', "~> 0.1.0"
end

group :staging, :production do
  gem 'newrelic_rpm', "~> 4.0.0.332"
end

group :development, :test, :staging do
  gem 'byebug', "~> 9.1.0", platform: :mri
  gem 'pry-rails', "~> 0.3.6"
  gem 'pry-byebug', "~> 3.5.0"
  gem 'rspec-rails', '~> 3.6.1'
end

group :development do
  gem 'mailcatcher', "~> 0.2.4"
  gem 'pry-rescue', "~> 1.4.5"
  gem 'pry-stack_explorer', "~> 0.4.9.2"
  gem 'rubocop-rails', "~> 2.3.2"
  gem 'spring', "~> 2.0.2"
  gem 'spring-watcher-listen', '~> 2.0.1'
  gem 'web-console', '~> 3.5.1'
end

group :test do
  gem 'database_cleaner', "~> 1.6.1"
  gem 'factory_girl_rails', "~> 4.8.0"
end

group :development do
  gem 'flamegraph', "~> 0.9.5"
  gem 'memory_profiler', "~> 0.9.8"
  gem 'rack-mini-profiler', "~> 0.10.5"
  gem 'stackprof', "~> 0.2.10"
end

我已經嘗試過這里提到的解決方案,例如gem install libv8 -v '8.4.255.0' -- --with-system-v8但沒有運氣......僅供參考,我正在嘗試在 M1 芯片上運行我的應用程序. 也不確定這是否相關但是當我運行rails -v我看到這個錯誤:

Ignoring nokogiri-1.10.2 because its extensions are not built. Try: gem pristine nokogiri --version 1.10.2
Ignoring racc-1.6.0 because its extensions are not built. Try: gem pristine racc --version 1.6.0
Ignoring nokogiri-1.10.2 because its extensions are not built. Try: gem pristine nokogiri --version 1.10.2
Ignoring racc-1.6.0 because its extensions are not built. Try: gem pristine racc --version 1.6.0

    Rails 7 requires Ruby 2.7.0 or newer.

    You're running
      ruby 2.6.8p205 (2021-07-07 revision 67951) [universal.arm64e-darwin21]

    Please upgrade to Ruby 2.7.0 or newer to continue. 

但是ruby -v顯示:
ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-darwin21]

在您要使用的 ruby 的 gemfile 版本中指定

ruby '2.7.0'
#or you if want to '2.7.2'
source 'https://rubygems.org'

之后顯示輸入。 如果我認為正確,捆綁 gemfile 將有一些默認的 ruby 版本,如果沒有指定特定的版本

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM