rails 3.2.2上的gem'twitter-bootstrap-rails'错误

时间:2012-03-15 03:04:45

标签: ruby-on-rails twitter-bootstrap

当我添加:

 gem 'twitter-bootstrap-rails' 

在我的Gemfile中运行:

bundle install

我得到错误:

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<T>& 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: d:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/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 d:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/therubyracer-0.9.10 for inspe
ction.
Results logged to d:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/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.

3 个答案:

答案 0 :(得分:2)

克利夫的解决方法帮助了我。理想情况下,我会解决实际问题,但将静态分支添加到我的gemfile是一个很好的解决方法,可以在辅助Windows PC上进行开发。

来自twitter-bootstrap-rails自述文件:

使用静态CSS,JS(没有更少)

twitter-bootstrap-rails有一个单独的分支(w / o Less),它只提供最新的静态CSS,JS文件。您可以从最新版本(从分支)安装:

gem'twitter-bootstrap-rails',:git =&gt; 'git://github.com/seyhunak/twitter-bootstrap-rails.git',: branch =&gt; '静态'

答案 1 :(得分:1)

您可以在Windows中安装therubyracer,

https://github.com/hiranpeiris/therubyracer_for_windows

我也有一些问题,例如当我尝试安装twitter-bootstrap-rails其依赖'therubyracer'时,我按照指示完成了它的工作(Windows 7)

答案 2 :(得分:0)

解决方法是使用使用静态CSS的twitter-bootstrap-rails版本,而不依赖于therubyracer。在你的Gemfile中试试这个:

gem'twitter-bootstrap-rails',:git =&gt; “GIT中://github.com/seyhunak/twitter-bootstrap-rails