Ruby on rails 在fedora 20上安装TheRubyRacer gem时出错

Ruby on rails 在fedora 20上安装TheRubyRacer gem时出错,ruby-on-rails,ruby,compiler-errors,bundler,fedora,Ruby On Rails,Ruby,Compiler Errors,Bundler,Fedora,我正在做一个项目,需要一个机器人。当我安装bundle时,当bundler尝试安装rubyracer时,我会收到以下错误消息 Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. /usr/bin/ruby extconf.rb checking for main() in -lpthread... yes checking for v8.h... yes creating

我正在做一个项目,需要一个机器人。当我安装bundle时,当bundler尝试安装rubyracer时,我会收到以下错误消息

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

    /usr/bin/ruby extconf.rb 
checking for main() in -lpthread... yes
checking for v8.h... yes
creating Makefile

make "DESTDIR="
g++ -I. -I/usr/include -I/usr/include/ruby/backward -I/usr/include -I. -D_FILE_OFFSET_BITS=64  -Wall -g -rdynamic -fPIC -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -march=i686 -mtune=atom -fasynchronous-unwind-tables -m32 -o init.o -c init.cc
g++ -I. -I/usr/include -I/usr/include/ruby/backward -I/usr/include -I. -D_FILE_OFFSET_BITS=64  -Wall -g -rdynamic -fPIC -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -march=i686 -mtune=atom -fasynchronous-unwind-tables -m32 -o signature.o -c signature.cc
g++ -I. -I/usr/include -I/usr/include/ruby/backward -I/usr/include -I. -D_FILE_OFFSET_BITS=64  -Wall -g -rdynamic -fPIC -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -march=i686 -mtune=atom -fasynchronous-unwind-tables -m32 -o exception.o -c exception.cc
g++ -I. -I/usr/include -I/usr/include/ruby/backward -I/usr/include -I. -D_FILE_OFFSET_BITS=64  -Wall -g -rdynamic -fPIC -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -march=i686 -mtune=atom -fasynchronous-unwind-tables -m32 -o primitive.o -c primitive.cc
g++ -I. -I/usr/include -I/usr/include/ruby/backward -I/usr/include -I. -D_FILE_OFFSET_BITS=64  -Wall -g -rdynamic -fPIC -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -march=i686 -mtune=atom -fasynchronous-unwind-tables -m32 -o context.o -c context.cc
In file included from context.cc:1:0:
context.cc: In static member function ‘static VALUE rr::Context::SetEmbedderData(VALUE, VALUE, VALUE)’:
context.cc:81:23: error: ‘class v8::Context’ has no member named ‘SetEmbedderData’
   Void(Context(self)->SetEmbedderData(NUM2INT(index), Value(data)));
                       ^
rr.h:33:20: note: in definition of macro ‘Void’
 #define Void(expr) expr; return Qnil;
                    ^
context.cc: In static member function ‘static VALUE rr::Context::GetEmbedderData(VALUE, VALUE)’:
context.cc:85:23: error: ‘class v8::Context’ has no member named ‘GetEmbedderData’
   Void(Context(self)->GetEmbedderData(NUM2INT(index)));
                       ^
rr.h:33:20: note: in definition of macro ‘Void’
 #define Void(expr) expr; return Qnil;
                    ^
make: *** [context.o] Error 1


Gem files will remain installed in /home/anupam/.gem/ruby/gems/therubyracer-0.12.1 for inspection.
Results logged to /home/anupam/.gem/ruby/gems/therubyracer-0.12.1/ext/v8/gem_make.out
An error occurred while installing therubyracer (0.12.1), and Bundler cannot continue.
Make sure that `gem install therubyracer -v '0.12.1'` succeeds before bundling.
当我运行gem安装rubyracer-v'0.12.1'或不运行该版本时,它仍然失败

我是ruby的新手,所以我不太明白到底发生了什么,也不明白它为什么会失败

非常感谢您的帮助。

我删除了所有宝石

卸载的ruby

重新安装ruby-devel

安装了ruby和ruby-devel,并使用yum而不是gem安装了rubyracer和libv8

然后我运行bundle安装,gem使用了已经安装的、由yum安装的gem


感谢上帝为fedora的维护者!你们真是太棒了

我知道这听起来很愚蠢,但我确实遇到了问题,而且我似乎缺少gcc-c++软件包。我想他们已经有了
yum安装gcc-c++
成功了

我在Fedora 24 x64上遇到了同样的问题,
sudo dnf-y安装gcc-c++
解决了我的问题

尝试以下操作:
gem安装therubyracer-v'0.12.1'--with-system-v8
没有调试消息。只是一条没有任何提示的直接错误消息[anupam@localhosttherubyracer-0.12.1]$gem安装therubyracer-v“0.12.1”--with-system-v8使用“--with-system-v8”构建本机扩展这可能需要一段时间。。。错误:安装RubyRacer时出错:错误:无法生成gem本机扩展。Gem文件仍将安装在/home/anupam/.Gem/ruby/gems/therubyracer-0.12.1中以供检查。