相关疑难解决方法(0)

安装libv8时出错:错误:无法构建gem本机扩展

我做了一个铁轨项目,

rails new test_bootstrap.
Run Code Online (Sandbox Code Playgroud)

成功了.

搬到了项目目录并添加了宝石

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

并运行

bundle install
Run Code Online (Sandbox Code Playgroud)

之后,我有这个错误.

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 …
Run Code Online (Sandbox Code Playgroud)

ruby windows ruby-on-rails libv8

172
推荐指数
6
解决办法
9万
查看次数

osx mavericks没有安装"gem install therubyracer -v'0.10.2"

尝试使用"gem install therubyracer -v'0.10.2'"在小牛上安装therubyracer但是我收到以下错误:

/Users/dennischen/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
checking for main() in -lobjc... yes
creating Makefile

make
compiling rr.cpp
clang: warning: argument unused during compilation: '-rdynamic'
rr.cpp:48:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
1 warning generated.
compiling v8.cpp
clang: warning: argument unused during compilation: '-rdynamic'
compiling v8_array.cpp
clang: warning: argument unused during compilation: '-rdynamic'
compiling v8_callbacks.cpp
clang: warning: argument unused during compilation: '-rdynamic'
compiling v8_context.cpp
clang: warning: argument unused during compilation: '-rdynamic'
compiling v8_date.cpp
clang: warning: argument unused …
Run Code Online (Sandbox Code Playgroud)

macos gem ruby-on-rails therubyracer osx-mavericks

90
推荐指数
5
解决办法
4万
查看次数

therubyracer - Gem :: Ext :: BuildError:错误:无法构建gem原生扩展

我正在尝试在Mavericks上安装以下gem版本

  • libv8(3.16.14.3)
  • therubyracer(0.12.1)

显然,therubyracer宝石取决于libv8.

1)安装libv8

什么是libv8?我的一些研究似乎表明它是Google Chrome使用的某种javascript库?

我在安装它时遇到了麻烦,但是这个很棒的帖子既有我的错误,也有关于如何绕过它的解释清楚的答案.

所以我安装libv8

gem install libv8 -- --with-system-v8
Run Code Online (Sandbox Code Playgroud)

这是我的理解,这安装了gem,但使用我的本地系统安装v8库而不是... gem附带的版本?无论哪种方式,它都是成功的.

2)安装therubyracer

在下一步中,我在安装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. …
Run Code Online (Sandbox Code Playgroud)

ruby gcc therubyracer libv8 osx-mavericks

73
推荐指数
6
解决办法
4万
查看次数

在OSX 10.10 Yosemite上安装Nokogiri

我最近升级到10.10优胜美地测试版,但是我在安装Nokogiri时遇到了麻烦.我正在使用RVM和Ruby 1.9.3.我也按照这里的步骤尝试按照Nokogiri主页上的说明进行操作.

我通过自制程序安装了libxml2(2.9.1)和libxslt(1.1.28),并尝试使用我的Xcode 5安装和Xcode 6 beta中的命令行工具.

gem install nokogiri -v '1.5.5'
Building native extensions.  This could take a while...
ERROR:  Error installing nokogiri:
    ERROR: Failed to build gem native extension.

        /Users/grantdavis/.rvm/rubies/ruby-1.9.3-p362/bin/ruby extconf.rb
checking for libxml/parser.h... *** 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 …
Run Code Online (Sandbox Code Playgroud)

ruby gem homebrew nokogiri bundler

53
推荐指数
7
解决办法
3万
查看次数

如何在新的Mountain Lion安装上安装libv8 ruby​​ gem?

我一直在讨厌这个问题.我在几个相关的帖子中都遵循了建议,但无济于事.

我从一个全新的Mountain Lion安装开始,安装了命令行工具,并根据我发现通过Homebrew安装gcc-4.2并在/ usr /中添加符号链接的其他一些帖子成功安装了Ruby 1.8.7斌/ GCC-4.2.

但是,现在我无法成功安装libv8.以下错误是我已经从现有建议中得到的.

任何额外的输入?

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /Users/Eric/.rbenv/versions/1.8.7-p352/bin/ruby extconf.rb 
creating Makefile
Unable to find a compiler officially supported by v8.
It is recommended to use GCC v4.4 or higher
Traceback (most recent call last):
  File "build/gyp/gyp", line 18, in <module>
    sys.exit(gyp.main(sys.argv[1:]))
  File "build/gyp/pylib/gyp/__init__.py", line 480, in main
    generator.GenerateOutput(flat_list, targets, data, params)
  File "build/gyp/pylib/gyp/generator/make.py", line 2085, in GenerateOutput
    part_of_all=qualified_target in needed_targets)
  File "build/gyp/pylib/gyp/generator/make.py", line 756, in Write
    self.xcode_settings, self.Absolutify, self.Pchify))
  File …
Run Code Online (Sandbox Code Playgroud)

ruby v8 ruby-on-rails-3 osx-mountain-lion

7
推荐指数
2
解决办法
9275
查看次数

gem install debugger -v'1.5.0'失败

我试图bundle在小牛队的大型项目中做一些宝石破坏或我的环境有问题,尽管这是rbenv的全新安装.

$ gem install debugger -v '1.5.0'
Building native extensions.  This could take a while...
ERROR:  Error installing debugger:
    ERROR: Failed to build gem native extension.

        /Users/samat/.rbenv/versions/1.9.3-p448/bin/ruby extconf.rb
checking for rb_method_entry_t.called_id in method.h... no
checking for rb_control_frame_t.method_id in method.h... no
checking for rb_method_entry_t.called_id in method.h... no
checking for rb_control_frame_t.method_id in method.h... no
Makefile creation failed
**************************************************************************
No source for ruby-1.9.3-p448 provided with debugger-ruby_core_source gem.
**************************************************************************
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably …
Run Code Online (Sandbox Code Playgroud)

ruby macos ruby-on-rails bundler rbenv

4
推荐指数
2
解决办法
3321
查看次数

在mac-therubyracer上运行"bundle install"时出错,无法安装

我正在尝试在运行OS X 10.9(Mavericks)的新macbook pro上第一次安装rails,我遇到了安装therubyracer的问题.当我做"捆绑安装"时,我收到此错误:

安装therubyracer(0.10.2)时发生错误,Bundler无法继续.gem install therubyracer -v '0.10.2'在捆绑之前确保成功.

然后我按照他们的指示运行

gem install therubyracer -v '0.10.2'

然后我收到此错误消息:

构建原生扩展.这可能需要一段时间...错误:安装therubyracer时出错:错误:无法构建gem原生扩展.

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb

在-lobjc中检查main()...是创建Makefile

make"DESTDIR ="编译rr.cpp clang:warning:编译期间未使用的参数:' - undynamic'rr.cpp:48:1:warning:control到达非void函数的结尾[-Wreturn-type]} ^ 1警告产生.编译v8.cpp clang:warning:编译期间未使用的参数:' - undynamic'编译v8_array.cpp clang:warning:编译期间未使用的参数:' - undynamic'编译v8_callbacks.cpp clang:warning:编译期间未使用的参数:' - dynamic '编译v8_context.cpp clang:warning:编译期间未使用的参数:' - undynamic'编译v8_date.cpp clang:warning:编译期间未使用的参数:' - undynamic'编译v8_debug.cpp clang:warning:编译期间未使用的参数:' - rdynamic'编译v8_exception.cpp clang:warning:编译期间未使用的参数:' - daynamic'v8_exception.cpp:10:16:警告:未使用的变量'stack'[-Wunused-variable] static void*stack [20]; 生成^ 1警告.编译v8_external.cpp clang:warning:编译期间未使用的参数:' - undynamic'v8_external.cpp:10:9:警告:未使用的变量'references'[-Wunused-variable] VALUE引用; 生成^ 1警告.编译v8_function.cpp clang:warning:编译期间未使用的参数:' - undynamic'编译v8_handle.cpp clang:warning:编译期间未使用的参数:' - undynamic'编译v8_locker.cpp clang:warning:编译期间未使用的参数:' - deynamic 'v8_locker.cpp:45:5:警告:控制到达非空函数的结尾[-Wreturn-type]} ^ v8_locker.cpp:85:5:警告:控制到达非空函数的结尾[-Wreturn-type生成了} ^ 2个警告.编译v8_message.cpp …

macos rubygems ruby-on-rails osx-mavericks

4
推荐指数
2
解决办法
8472
查看次数