Ruby on Rails - 设置Bootstrap 3 - 软件包安装错误

时间:2014-04-03 19:53:05

标签: ruby-on-rails ruby twitter-bootstrap

我试图让这个工作:twitter-bootstrap-rails,但如果我输入bundle install,我会收到以下错误:

Fetching gem metadata from https://rubygems.org/..........
Fetching additional metadata from https://rubygems.org/..
Resolving dependencies...
[...]
Using sqlite3 1.3.9

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

        C:/_Festplatte_D/RubyOnRails/Ruby1.9.3/bin/ruby.exe extconf.rb
checking for main() in -lpthread... no
checking for v8.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
        [...]
C:/_Festplatte_D/RubyOnRails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/libv8-3.16.14.3/
ext/libv8/location.rb:50:in `configure': You have chosen to use the version of V
8 found on your system (Libv8::Location::System::NotFoundError)
and *not* the one that is bundle with the libv8 rubygem. However,
it could not be located. please make sure you have a version of
v8 that is compatible with 3.16.14.3 installed. You may
need to special --with-v8-dir options if it is in a non-standard
location

thanks,
The Mgmt

        from C:/_Festplatte_D/RubyOnRails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/lib
v8-3.16.14.3/lib/libv8.rb:7:in `configure_makefile'
        from extconf.rb:32:in `<main>'


Gem files will remain installed in C:/_Festplatte_D/RubyOnRails/Ruby1.9.3/lib/ru
by/gems/1.9.1/gems/therubyracer-0.12.1 for inspection.
Results logged to C:/_Festplatte_D/RubyOnRails/Ruby1.9.3/lib/ruby/gems/1.9.1/gem
s/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.

我也试过这个解决方案therubyracer_for_windows,但它对我没有用......

我使用的是win7,ruby1.9.3,rails4,...

有没有人可以帮助我?

3 个答案:

答案 0 :(得分:0)

您添加的gem是用于在您提供的github repo上读取的bootstrap 2.3.2:

Twitter Bootstrap 2.3.2 for Rails Asset Pipeline

对于bootstrap 3,你也可以使用同一作者的sass gem: 只需添加

gem 'bootstrap-sass'
你的Gemfile上的

答案 1 :(得分:0)

您正在使用twitter-bootstrap-rails gem。如果您使用 bootstrap-sass gem,这是官方支持的Bootstrap gem,您将获得最新的Bootstrap v3.2,并且在Windows上安装它时不会遇到任何问题。

有关如何将Bootstrap与Rails集成的示例应用程序,请参阅:

  

<强> Rails and Bootstrap

答案 2 :(得分:0)

解决方案:

这听起来很愚蠢,但是我卸载了所有Ruby-Versions(还有一些来自较旧的项目)并且还卸载了所有,这取决于Ruby(Ruby on Rails)。

然后我决定谷歌哪个版本稳定且相互兼容(Ruby和RoR)。 之后我安装了ruby 1.9.3p545 (2014-02-24) [i386-mingw32]Rails 4.0.4

此外,我将环境变量设置如下: (因为刚刚列出了旧版路径)

  • 路径
  • %RUBY_HOME%\ bin中;%JAVA_HOME%\ bin中

&安培;

  • RUBY_HOME
  • C:\ Ruby193 \

最后我发现这很简单&amp;快Tutorial

现在一切正常。 不管怎样,谢谢以上所有人:]