当我执行“捆绑更新”时,我从gem中获取错误,而不是在我的gemfile中。 我如何忽略这种依赖?

我正在使用一个使用twitter-bootstrap-rails的项目。 这个项目是在Linux机器上构建的,并使用therubyracer作为javascript运行时。 我一直在遇到问题,因为therubyracer似乎与Windows并不相处。

在windows上的therubyracergem

现在我正在尝试“捆绑更新”; “therubyracer”令人窒息。

我想我应该能够依靠JScript。 我如何告诉bundler忽略这一点,而不是深入研究每个gem并手动删除它对therubyracer的依赖? 看起来像bootstrap,或者至少是twitter-bootstrap-rails,取决于therubyracer。

编辑:我已经按照该线程中的说明进行操作,并且我继续获得以下内容(在安装捆绑软件之后):

Installing railties (3.2.0) Installing coffee-rails (3.2.2) Installing libv8 (3.3.10.4) with native extensions Installing therubyracer (0.9.10) with native extensions Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. C:/Ruby/bin/ruby.exe extconf.rb creating Makefile make generating v8-i386-mingw32.def compiling rr.cpp cc1plus.exe: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++ cc1plus.exe: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++ rr.cpp: In function 'VALUE rr_define_finalizer(VALUE, void*, VALUE)': rr.cpp:48:1: warning: no return statement in function returning non-void In file included from rr.cpp:3:0: v8_handle.h: In function 'v8::Persistent& rr_v8_handle(VALUE) [with T = v8::Value, VALUE = long unsigned int]': rr.cpp:159:37: instantiated from here v8_handle.h:43:71: warning: dereferencing type-punned pointer will break strict-aliasing rules g++.exe: unrecognized option '-rdynamic' compiling v8.cpp cc1plus.exe: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++ cc1plus.exe: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++ g++.exe: unrecognized option '-rdynamic' compiling v8_array.cpp cc1plus.exe: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++ cc1plus.exe: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++ In file included from v8_array.cpp:1:0: v8_handle.h: In function 'v8::Persistent& rr_v8_handle(VALUE) [with T = v8::Array, VALUE = long unsigned int]': v8_array.cpp:13:36: instantiated from here v8_handle.h:43:71: warning: dereferencing type-punned pointer will break strict-aliasing rules g++.exe: unrecognized option '-rdynamic' compiling v8_callbacks.cpp cc1plus.exe: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++ cc1plus.exe: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++ g++.exe: unrecognized option '-rdynamic' compiling v8_context.cpp cc1plus.exe: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++ cc1plus.exe: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++ In file included from v8_context.cpp:2:0: v8_handle.h: In function 'v8::Persistent& rr_v8_handle(VALUE) [with T = v8::Context, VALUE = long unsigned int]': v8_context.cpp:15:39: instantiated from here v8_handle.h:43:71: warning: dereferencing type-punned pointer will break strict-aliasing rules v8_handle.h: In function 'v8::Persistent& rr_v8_handle(VALUE) [with T = v8::ObjectTemplate, VALUE = long unsigned int]': v8_context.cpp:22:143: instantiated from here v8_handle.h:43:71: warning: dereferencing type-punned pointer will break strict-aliasing rules v8_handle.h: In function 'v8::Persistent& rr_v8_handle(VALUE) [with T = v8::Value, VALUE = long unsigned int]': v8_context.cpp:23:110: instantiated from here v8_handle.h:43:71: warning: dereferencing type-punned pointer will break strict-aliasing rules g++.exe: unrecognized option '-rdynamic' compiling v8_date.cpp cc1plus.exe: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++ cc1plus.exe: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++ In file included from v8_date.cpp:4:0: v8_handle.h: In function 'v8::Persistent& rr_v8_handle(VALUE) [with T = v8::Date, VALUE = long unsigned int]': v8_date.cpp:21:52: instantiated from here v8_handle.h:43:71: warning: dereferencing type-punned pointer will break strict-aliasing rules g++.exe: unrecognized option '-rdynamic' compiling v8_debug.cpp cc1plus.exe: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++ cc1plus.exe: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++ g++.exe: unrecognized option '-rdynamic' compiling v8_exception.cpp cc1plus.exe: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++ cc1plus.exe: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++ In file included from v8_exception.cpp:3:0: v8_handle.h: In function 'v8::Persistent& rr_v8_handle(VALUE) [with T = v8::StackTrace, VALUE = long unsigned int]': v8_exception.cpp:48:44: instantiated from here v8_handle.h:43:71: warning: dereferencing type-punned pointer will break strict-aliasing rules v8_handle.h: In function 'v8::Persistent& rr_v8_handle(VALUE) [with T = v8::StackFrame, VALUE = long unsigned int]': v8_exception.cpp:68:43: instantiated from here v8_handle.h:43:71: warning: dereferencing type-punned pointer will break strict-aliasing rules v8_exception.cpp: At global scope: v8_exception.cpp:10:24: warning: '::stack' defined but not used g++.exe: unrecognized option '-rdynamic' compiling v8_external.cpp cc1plus.exe: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++ cc1plus.exe: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++ In file included from v8_external.cpp:4:0: v8_handle.h: In function 'v8::Persistent& rr_v8_handle(VALUE) [with T = v8::External, VALUE = long unsigned int]': v8_external.cpp:51:60: instantiated from here v8_handle.h:43:71: warning: dereferencing type-punned pointer will break strict-aliasing rules v8_external.cpp: At global scope: v8_external.cpp:10:9: warning: '::references' defined but not used g++.exe: unrecognized option '-rdynamic' compiling v8_function.cpp cc1plus.exe: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++ cc1plus.exe: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++ In file included from v8_function.cpp:5:0: v8_handle.h: In function 'v8::Persistent& rr_v8_handle(VALUE) [with T = v8::Function, VALUE = long unsigned int]': v8_function.cpp:13:40: instantiated from here v8_handle.h:43:71: warning: dereferencing type-punned pointer will break strict-aliasing rules v8_handle.h: In function 'v8::Persistent& rr_v8_handle(VALUE) [with T = v8::Array, VALUE = long unsigned int]': v8_function.cpp:23:55: instantiated from here v8_handle.h:43:71: warning: dereferencing type-punned pointer will break strict-aliasing rules v8_handle.h: In function 'v8::Persistent& rr_v8_handle(VALUE) [with T = v8::String, VALUE = long unsigned int]': v8_function.cpp:49:51: instantiated from here v8_handle.h:43:71: warning: dereferencing type-punned pointer will break strict-aliasing rules g++.exe: unrecognized option '-rdynamic' compiling v8_handle.cpp cc1plus.exe: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++ cc1plus.exe: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++ g++.exe: unrecognized option '-rdynamic' compiling v8_locker.cpp cc1plus.exe: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++ cc1plus.exe: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++ v8_locker.cpp: In function 'VALUE::Lock::Delete(VALUE)': v8_locker.cpp:45:5: warning: no return statement in function returning non-void v8_locker.cpp: In function 'VALUE::Unlock::Delete(VALUE)': v8_locker.cpp:85:5: warning: no return statement in function returning non-void g++.exe: unrecognized option '-rdynamic' compiling v8_message.cpp cc1plus.exe: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++ cc1plus.exe: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++ In file included from v8_message.cpp:2:0: v8_handle.h: In function 'v8::Persistent& rr_v8_handle(VALUE) [with T = v8::Message, VALUE = long unsigned int]': v8_message.cpp:10:38: instantiated from here v8_handle.h:43:71: warning: dereferencing type-punned pointer will break strict-aliasing rules g++.exe: unrecognized option '-rdynamic' compiling v8_object.cpp cc1plus.exe: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++ cc1plus.exe: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++ In file included from v8_object.cpp:1:0: v8_handle.h: In function 'v8::Persistent& rr_v8_handle(VALUE) [with T = v8::Object, VALUE = long unsigned int]': v8_object.cpp:17:39: instantiated from here v8_handle.h:43:71: warning: dereferencing type-punned pointer will break strict-aliasing rules g++.exe: unrecognized option '-rdynamic' compiling v8_script.cpp cc1plus.exe: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++ cc1plus.exe: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++ In file included from v8_script.cpp:2:0: v8_handle.h: In function 'v8::Persistent& rr_v8_handle(VALUE) [with T = v8::Script, VALUE = long unsigned int]': v8_script.cpp:25:56: instantiated from here v8_handle.h:43:71: warning: dereferencing type-punned pointer will break strict-aliasing rules g++.exe: unrecognized option '-rdynamic' compiling v8_string.cpp cc1plus.exe: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++ cc1plus.exe: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++ In file included from v8_string.cpp:3:0: v8_handle.h: In function 'v8::Persistent& rr_v8_handle(VALUE) [with T = v8::String, VALUE = long unsigned int]': v8_string.cpp:13:38: instantiated from here v8_handle.h:43:71: warning: dereferencing type-punned pointer will break strict-aliasing rules g++.exe: unrecognized option '-rdynamic' compiling v8_template.cpp cc1plus.exe: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++ cc1plus.exe: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++ In file included from v8_template.cpp:2:0: v8_handle.h: In function 'v8::Persistent& rr_v8_handle(VALUE) [with T = v8::Template, VALUE = long unsigned int]': v8_template.cpp:42:39: instantiated from here v8_handle.h:43:71: warning: dereferencing type-punned pointer will break strict-aliasing rules v8_handle.h: In function 'v8::Persistent& rr_v8_handle(VALUE) [with T = v8::ObjectTemplate, VALUE = long unsigned int]': v8_template.cpp:45:45: instantiated from here v8_handle.h:43:71: warning: dereferencing type-punned pointer will break strict-aliasing rules v8_handle.h: In function 'v8::Persistent& rr_v8_handle(VALUE) [with T = v8::FunctionTemplate, VALUE = long unsigned int]': v8_template.cpp:48:47: instantiated from here v8_handle.h:43:71: warning: dereferencing type-punned pointer will break strict-aliasing rules v8_handle.h: In function 'v8::Persistent& rr_v8_handle(VALUE) [with T = v8::Data, VALUE = long unsigned int]': v8_template.cpp:54:53: instantiated from here v8_handle.h:43:71: warning: dereferencing type-punned pointer will break strict-aliasing rules g++.exe: unrecognized option '-rdynamic' compiling v8_try_catch.cpp cc1plus.exe: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++ cc1plus.exe: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++ g++.exe: unrecognized option '-rdynamic' compiling v8_v8.cpp cc1plus.exe: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++ cc1plus.exe: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++ g++.exe: unrecognized option '-rdynamic' compiling v8_value.cpp cc1plus.exe: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++ cc1plus.exe: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++ In file included from v8_value.cpp:1:0: v8_handle.h: In function 'v8::Persistent& rr_v8_handle(VALUE) [with T = v8::Value, VALUE = long unsigned int]': v8_value.cpp:10:37: instantiated from here v8_handle.h:43:71: warning: dereferencing type-punned pointer will break strict-aliasing rules g++.exe: unrecognized option '-rdynamic' compiling v8_weakref.cpp cc1plus.exe: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++ cc1plus.exe: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++ g++.exe: unrecognized option '-rdynamic' linking shared-object v8.so g++.exe: C:/inetpub/wwwroot/app/development/ruby/1.9.1/gems/libv8-3.3.10.4/lib/libv8/build/v8/libv8.a: No such file or directory make: *** [v8.so] Error 1 Gem files will remain installed in C:/inetpub/wwwroot/app/development/ruby/1.9.1/gems/therubyracer-0.9.10 for inspection. Results logged to C:/inetpub/wwwroot/app/development/ruby/1.9.1/gems/therubyracer-0.9.10/ext/v8/gem_make.out An error occured while installing therubyracer (0.9.10), and Bundler cannot continue. Make sure that `gem install therubyracer -v '0.9.10'` succeeds before bundling. 

有一个版本的twitter-bootstrap-rails使用静态CSS,不依赖于therubyracer。 在你的Gemfile中试试这个:

 gem 'twitter-bootstrap-rails', :git => "git://github.com/seyhunak/twitter-bootstrap-rails.git", :branch => "static" 

另一位成员在这里帮助我:

告诉Bundler从特定gem的安装中排除某些gem

这被标记为“微不足道”而没有内容,但我不想复制/粘贴不属于我的内容,所以只需输入即可。