在Windows上使用twitter-bootstrap-rails生成器警告 [英] Warning using twitter-bootstrap-rails generators on Windows

查看:103
本文介绍了在Windows上使用twitter-bootstrap-rails生成器警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在我的第一个Rails项目上使用twitter-bootstrap-rails gem,在Windows 7机器上运行

I'm trying to use the twitter-bootstrap-rails gem on my first Rails project, on a Windows 7 machine running

ruby 1.9.3p125 (2012-02-16) [i386-mingw32]
Rails 3.2.1
twitter-bootstrap-rails 2.1.1

当我运行 rails g bootstrap:install 时,我得到以下内容:

When I run rails g bootstrap:install I get the following:

[WARNING] Please install gem 'therubyracer' to use Less.
    C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler/runtime.rb:74:in `require': cannot load such file -- twitter/bootstrap/rails (LoadError)
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-.1.5/lib/bundler/runtime.rb:74:in 'rescue in block in require'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-.1.5/lib/bundler/runtime.rb:62:in 'block in require'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-.1.5/lib/bundler/runtime.rb:55:in 'each'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-.1.5/lib/bundler/runtime.rb:55:in 'require'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-.1.5/lib/bundler.rb:119:in `require'
        from H:/Dev/sugarcane/config/application.rb:7:in `<top (required)>'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.1/lib/rails/commands.rb:24:in `require'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.1/lib/rails/commands.rb:24:in `<top (required)>'
        from script/rails:6:in `require'
        from script/rails:6:in `<main>'

这是我的Gemfile:

Here's my Gemfile:

source 'https://rubygems.org'
gem 'rails', '3.2.1'
gem 'pg'

group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'
  gem 'twitter-bootstrap-rails', :git => 'git://github.com/seyhunak/twitter-bootstrap-rails.git'
  gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'

我试过包括 gem therubyracer 在我的Gemfile中,但是我得到了有关libv8 gem的编译错误,而不可用视窗的。我也试过 gem therubyracer,:platform => :ruby ,但Bundler仍会尝试在 bundle install 上安装therubyracer。我也尝试安装node.js,并且包含 gem execjs ,但无济于事。

I've tried including gem therubyracer in my Gemfile, but I get compilation errors about the libv8 gem, which isn't available on Windows. I've also tried gem therubyracer, :platform => :ruby, but Bundler still attempts to install therubyracer on bundle install. I also tried installing node.js and including gem execjs, but to no avail.

我遇到的每个解决方案似乎没有任何帮助。我想在这个项目中使用LESS而不是静态CSS,所以一个允许我在Windows机器上使用LESS和Rails的解决方案将是最有帮助的。

Every solution I come across doesn't seem to help at all. I'd like to use LESS rather than static CSS on this project, so a solution to allow me to use LESS with Rails on a Windows machine would be most helpful.

推荐答案

我已经转向使用 bootstrap-sass gem。

I've switched to using the bootstrap-sass gem.

因此,我可以使用SASS作为CSS预处理器,而不是使用LESS。缺点是它没有任何代码生成器。

So instead of using LESS, I can use SASS as a CSS preprocessor. The downside is that it doesn't appear to have any code generators.

这篇关于在Windows上使用twitter-bootstrap-rails生成器警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆