【问题标题】:gem 'twitter-bootstrap-rails' error on rails 3.2.2rails 3.2.2 上的 gem 'twitter-bootstrap-rails' 错误
【发布时间】:2012-03-15 03:04:44
【问题描述】:

当我添加时:

 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.

【问题讨论】:

  • 看来问题出在 Windows 上的 ruby​​ racer,请查看:stackoverflow.com/questions/6356450/therubyracer-gem-on-windows
  • 是的...我在工作中被困在 Windows 上开发,不得不在我的本地 Gemfile 上注释掉 gem 'therubyracer
  • 谢谢。我知道原因。因为 libv8 没有适用于 windows 的版本。

标签: ruby-on-rails twitter-bootstrap


【解决方案1】:

Cliff 的解决方法帮助了我。理想情况下,我会解决实际问题,但将静态分支添加到我的 gemfile 是在辅助 Windows PC 上开发的足够好的解决方法。

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

使用静态 CSS、JS(w/o Less)

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

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

【讨论】:

  • 别忘了,如果你使用静态分支,你必须将编译好的 bootstrap.css 文件添加到你的资产管道中,方法是在你的 application.css 文件中添加以下行: /* *=需要引导 */
【解决方案2】:

您可以在 Windows 中安装 therubyracer,

https://github.com/hiranpeiris/therubyracer_for_windows

我也遇到了一些问题,比如当我尝试安装 twitter-bootstrap-rails 它的依赖项 'therubyracer' 时,我按照说明操作并且它在 (Windows 7) 上完美运行

【讨论】:

    【解决方案3】:

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-10-05
      • 2012-05-31
      • 2012-02-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多