在 mac mojave 上安装旧版本的 therubyracer(v0.9.10) gem

install older version of therubyracer(v0.9.10) gem on mac mojave

这是我第一次在 rails 上使用 ruby。

我从 github 克隆了这个项目。

https://github.com/fredwu/angel_nest

我花了一些时间来设置和解决问题。 我有很多兼容性问题,因为这个项目是很久以前做的。

当我做 "bundle install"
我收到此错误,捆绑程序停止。

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. /Users/divyanshuverma/.rvm/rubies/ruby-1.9.3-p551/bin/ruby extconf.rb checking for main() in -lobjc... yes creating Makefile

make compiling v8_external.cpp clang: warning: argument unused during compilation: '-rdynamic' [-Wunused-command-line-argument] v8_external.cpp:10:9: warning: unused variable 'references' [-Wunused-variable] VALUE references; ^ 1 warning generated. compiling v8_exception.cpp clang: warning: argument unused during compilation: '-rdynamic' [-Wunused-command-line-argument] v8_exception.cpp:10:16: warning: unused variable 'stack' [-Wunused-variable] static void* stack[20]; ^ 1 warning generated. compiling v8_function.cpp clang: warning: argument unused during compilation: '-rdynamic' [-Wunused-command-line-argument] compiling v8_handle.cpp clang: warning: argument unused during compilation: '-rdynamic' [-Wunused-command-line-argument] compiling v8_array.cpp clang: warning: argument unused during compilation: '-rdynamic' [-Wunused-command-line-argument] compiling v8_try_catch.cpp clang: warning: argument unused during compilation: '-rdynamic' [-Wunused-command-line-argument] compiling v8_v8.cpp clang: warning: argument unused during compilation: '-rdynamic' [-Wunused-command-line-argument] v8_v8.cpp:22:49: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32] V8::SetFlagsFromString(RSTRING_PTR(string), RSTRING_LEN(string)); ~~ ^~~~~~~~~~~~~~~~~~~ /Users/divyanshuverma/.rvm/rubies/ruby-1.9.3-p551/include/ruby-1.9.1/ruby/ruby.h:674:6: note: expanded from macro 'RSTRING_LEN' RSTRING_EMBED_LEN(str) : \ ^~~~~~~~~~~~~~~~~~~~~~ /Users/divyanshuverma/.rvm/rubies/ruby-1.9.3-p551/include/ruby-1.9.1/ruby/ruby.h:670:6: note: expanded from macro 'RSTRING_EMBED_LEN' (long)((RBASIC(str)->flags >> RSTRING_EMBED_LEN_SHIFT) & \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ v8_v8.cpp:22:49: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32] V8::SetFlagsFromString(RSTRING_PTR(string), RSTRING_LEN(string)); ~~ ^~~~~~~~~~~~~~~~~~~ /Users/divyanshuverma/.rvm/rubies/ruby-1.9.3-p551/include/ruby-1.9.1/ruby/ruby.h:675:28: note: expanded from macro 'RSTRING_LEN' RSTRING(str)->as.heap.len) ~~~~~~~~~~~~~~~~~~~~~~^~~ 2 warnings generated. compiling v8_callbacks.cpp clang: warning: argument unused during compilation: '-rdynamic' [-Wunused-command-line-argument] compiling v8_string.cpp clang: warning: argument unused during compilation: '-rdynamic' [-Wunused-command-line-argument] v8_string.cpp:18:73: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32] return rr_v8_handle_new(string_class, String::New(RSTRING_PTR(str), RSTRING_LEN(str))); ~~~~~~ ^~~~~~~~~~~~~~~~ /Users/divyanshuverma/.rvm/rubies/ruby-1.9.3-p551/include/ruby-1.9.1/ruby/ruby.h:674:6: note: expanded from macro 'RSTRING_LEN' RSTRING_EMBED_LEN(str) : \ ^~~~~~~~~~~~~~~~~~~~~~ /Users/divyanshuverma/.rvm/rubies/ruby-1.9.3-p551/include/ruby-1.9.1/ruby/ruby.h:670:6: note: expanded from macro 'RSTRING_EMBED_LEN' (long)((RBASIC(str)->flags >> RSTRING_EMBED_LEN_SHIFT) & \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ v8_string.cpp:18:73: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32] return rr_v8_handle_new(string_class, String::New(RSTRING_PTR(str), RSTRING_LEN(str))); ~~~~~~ ^~~~~~~~~~~~~~~~ /Users/divyanshuverma/.rvm/rubies/ruby-1.9.3-p551/include/ruby-1.9.1/ruby/ruby.h:675:28: note: expanded from macro 'RSTRING_LEN' RSTRING(str)->as.heap.len) ~~~~~~~~~~~~~~~~~~~~~~^~~ v8_string.cpp:23:79: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32] return rr_v8_handle_new(string_class, String::NewSymbol(RSTRING_PTR(str), RSTRING_LEN(str))); ~~~~~~ ^~~~~~~~~~~~~~~~ /Users/divyanshuverma/.rvm/rubies/ruby-1.9.3-p551/include/ruby-1.9.1/ruby/ruby.h:674:6: note: expanded from macro 'RSTRING_LEN' RSTRING_EMBED_LEN(str) : \ ^~~~~~~~~~~~~~~~~~~~~~ /Users/divyanshuverma/.rvm/rubies/ruby-1.9.3-p551/include/ruby-1.9.1/ruby/ruby.h:670:6: note: expanded from macro 'RSTRING_EMBED_LEN' (long)((RBASIC(str)->flags >> RSTRING_EMBED_LEN_SHIFT) & \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ v8_string.cpp:23:79: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32] return rr_v8_handle_new(string_class, String::NewSymbol(RSTRING_PTR(str), RSTRING_LEN(str))); ~~~~~~ ^~~~~~~~~~~~~~~~ /Users/divyanshuverma/.rvm/rubies/ruby-1.9.3-p551/include/ruby-1.9.1/ruby/ruby.h:675:28: note: expanded from macro 'RSTRING_LEN' RSTRING(str)->as.heap.len) ~~~~~~~~~~~~~~~~~~~~~~^~~ 4 warnings generated. compiling v8_message.cpp clang: warning: argument unused during compilation: '-rdynamic' [-Wunused-command-line-argument] compiling rr.cpp clang: warning: argument unused during compilation: '-rdynamic' [-Wunused-command-line-argument] rr.cpp:48:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ rr.cpp:151:44: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32] return String::New(RSTRING_PTR(value), RSTRING_LEN(value)); ~~~~~~ ^~~~~~~~~~~~~~~~~~ /Users/divyanshuverma/.rvm/rubies/ruby-1.9.3-p551/include/ruby-1.9.1/ruby/ruby.h:674:6: note: expanded from macro 'RSTRING_LEN' RSTRING_EMBED_LEN(str) : \ ^~~~~~~~~~~~~~~~~~~~~~ /Users/divyanshuverma/.rvm/rubies/ruby-1.9.3-p551/include/ruby-1.9.1/ruby/ruby.h:670:6: note: expanded from macro 'RSTRING_EMBED_LEN' (long)((RBASIC(str)->flags >> RSTRING_EMBED_LEN_SHIFT) & \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ rr.cpp:151:44: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32] return String::New(RSTRING_PTR(value), RSTRING_LEN(value)); ~~~~~~ ^~~~~~~~~~~~~~~~~~ /Users/divyanshuverma/.rvm/rubies/ruby-1.9.3-p551/include/ruby-1.9.1/ruby/ruby.h:675:28: note: expanded from macro 'RSTRING_LEN' RSTRING(str)->as.heap.len) ~~~~~~~~~~~~~~~~~~~~~~^~~ 3 warnings generated. compiling v8_weakref.cpp clang: warning: argument unused during compilation: '-rdynamic' [-Wunused-command-line-argument] compiling v8_script.cpp clang: warning: argument unused during compilation: '-rdynamic' [-Wunused-command-line-argument] compiling v8_date.cpp clang: warning: argument unused during compilation: '-rdynamic' [-Wunused-command-line-argument] compiling v8_debug.cpp clang: warning: argument unused during compilation: '-rdynamic' [-Wunused-command-line-argument] compiling v8_value.cpp clang: warning: argument unused during compilation: '-rdynamic' [-Wunused-command-line-argument] v8_value.cpp:100:9: warning: unused function 'ToInt32' [-Wunused-function] VALUE ToInt32(VALUE self) { ^ 1 warning generated. compiling v8_object.cpp clang: warning: argument unused during compilation: '-rdynamic' [-Wunused-command-line-argument] v8_object.cpp:77:19: warning: unused variable 'proto' [-Wunused-variable] Handle proto(rr_rb2v8(prototype)); ^ 1 warning generated. compiling v8_locker.cpp clang: warning: argument unused during compilation: '-rdynamic' [-Wunused-command-line-argument] v8_locker.cpp:45:5: warning: control reaches end of non-void function [-Wreturn-type] } ^ v8_locker.cpp:85:5: warning: control reaches end of non-void function [-Wreturn-type] } ^ 2 warnings generated. compiling v8_template.cpp clang: warning: argument unused during compilation: '-rdynamic' [-Wunused-command-line-argument] compiling v8.cpp clang: warning: argument unused during compilation: '-rdynamic' [-Wunused-command-line-argument] compiling v8_context.cpp clang: warning: argument unused during compilation: '-rdynamic' [-Wunused-command-line-argument] linking shared-object v8.bundle clang: error: no such file or directory: '/Users/divyanshuverma/angel_nest/vendor/cache/ruby/1.9.1/gems/libv8-3.3.10.4/lib/libv8/build/v8/libv8.a' make: *** [v8.bundle] Error 1

Gem files will remain installed in /Users/divyanshuverma/angel_nest/vendor/cache/ruby/1.9.1/gems/therubyracer-0.9.10 for inspection. Results logged to /Users/divyanshuverma/angel_nest/vendor/cache/ruby/1.9.1/gems/therubyracer-0.9.10/ext/v8/gem_make.out An error occurred while installing therubyracer (0.9.10), and Bundler cannot continue. Make sure that gem install therubyracer -v '0.9.10' succeeds before bundling.

我已经针对此方法尝试了 Whosebug 上所有可用的方法,但 none 有效! 有什么方法可以覆盖此 gem 的要求进行更改,以便项目可以在较新版本的 rubyracer gem

上运行

此版本仅被Gemfile.lock锁定,这意味着项目本身可能没有特定要求。

您可以尝试只更新此 gem 而无需完整 bundle update 通过:bundle update therubyracer,很可能较新的版本就可以。