gpt4 book ai didi

ruby-on-rails - Xcode 4.4 和 OSX 10.8 安装后 - 安装 libv8 时为 'Failed to build gem native extension'

转载 作者:数据小太阳 更新时间:2023-10-29 06:57:58 24 4
gpt4 key购买 nike

我最近将 OSX 升级到 Mountain Lion (10.8) 和 Xcode (4.4),但在尝试让我的 Rails 环境正常工作时遇到了问题。我从运行 bundle install 开始,在安装 libv8 库时遇到错误。下面是完整错误的粘贴。我四处搜索并寻找类似的问题,但到目前为止我在 stackoverflow 上发现的内容不适用于我的问题。以下是我迄今为止尝试过但无济于事的几件事:

  • 安装 Xcode 命令行工具
  • 安装MySQL
  • 安装X11
  • 通过gemfile安装不同版本的libv8

现在我遇到的问题似乎超出了我的 ruby​​ 技能范围。如果有人对我可以尝试什么有一些想法或遇到类似问题,我很乐意提供帮助。谢谢!

这是我的 gemfile 的样子:

source 'https://rubygems.org'

gem 'rails', '3.2.6'
gem 'bundler'
gem 'rake'
gem 'sqlite3'
gem 'haml'
gem 'nokogiri'
gem 'whenever'
gem 'mysql'
gem 'mysql2'
gem 'jquery-rails'
gem 'capistrano'

# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'

# See https://github.com/sstephenson/execjs#readme for more supported runtimes
gem 'therubyracer', :platforms => :ruby

gem 'uglifier', '>= 1.0.3'
end

这是尝试安装 gems 时的错误日志:

sudo bundle install
Password:
Fetching source index for https://rubygems.org/
Using rake (0.9.2.2)
Using i18n (0.6.0)
Using multi_json (1.3.6)
Using activesupport (3.2.6)
Using builder (3.0.0)
Using activemodel (3.2.6)
Using erubis (2.7.0)
Using journey (1.0.4)
Using rack (1.4.1)
Using rack-cache (1.2)
Using rack-test (0.6.1)
Using hike (1.2.1)
Using tilt (1.3.3)
Using sprockets (2.1.3)
Using actionpack (3.2.6)
Using mime-types (1.19)
Using polyglot (0.3.3)
Using treetop (1.4.10)
Using mail (2.4.4)
Using actionmailer (3.2.6)
Using arel (3.0.2)
Using tzinfo (0.3.33)
Using activerecord (3.2.6)
Using activeresource (3.2.6)
Using bundler (1.0.15)
Using highline (1.6.13)
Using net-ssh (2.5.2)
Using net-scp (1.0.4)
Using net-sftp (2.0.5)
Using net-ssh-gateway (1.1.0)
Using capistrano (2.12.0)
Using chronic (0.6.7)
Using coffee-script-source (1.3.3)
Using execjs (1.4.0)
Using coffee-script (2.2.0)
Using rack-ssl (1.3.2)
Using json (1.7.3)
Using rdoc (3.12)
Using thor (0.15.4)
Using railties (3.2.6)
Using coffee-rails (3.2.2)
Using haml (3.1.6)
Using jquery-rails (2.0.2)
Installing libv8 (3.3.10.4) with native extensions /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/installer.rb:482:in `build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
*** 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
--without-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=/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
extconf.rb:13: uninitialized constant Gem (NameError)
Checking for Python...

Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/libv8-3.3.10.4 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/libv8-3.3.10.4/ext/libv8/gem_make.out
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/installer.rb:445:in `each'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/installer.rb:445:in `build_extensions'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/installer.rb:197:in `install'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/source.rb:101:in `install'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/rubygems_integration.rb:78:in `preserve_paths'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/source.rb:91:in `install'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/installer.rb:58:in `run'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/rubygems_integration.rb:93:in `with_build_args'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/installer.rb:57:in `run'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/spec_set.rb:12:in `each'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/spec_set.rb:12:in `each'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/installer.rb:49:in `run'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/installer.rb:8:in `install'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/cli.rb:222:in `install'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/vendor/thor/task.rb:22:in `send'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/vendor/thor/task.rb:22:in `run'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/vendor/thor.rb:246:in `dispatch'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/vendor/thor/base.rb:389:in `start'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/bin/bundle:13
from /usr/bin/bundle:19:in `load'
from /usr/bin/bundle:19

最佳答案

尝试添加

gem 'therubyracer', '0.11.0beta5'
gem 'libv8', '~> 3.11.8'

到你的 Gemfile。这对我有帮助。

关于ruby-on-rails - Xcode 4.4 和 OSX 10.8 安装后 - 安装 libv8 时为 'Failed to build gem native extension',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11677480/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com