[英]Installing bootstrap sass with compass
I'm trying to install bootstrap-sass and getting the error below. 我正在尝试安装bootstrap-sass并在下面收到错误。 I've tried an older version of sass but bundler keeps installing 3.3.0.
我尝试过较旧版本的sass,但是bundler一直在安装3.3.0。
WARN: Unresolved specs during Gem::Specification.reset:
sass (~> 3.2)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
/Library/Ruby/Gems/2.0.0/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches/browser_support.rb:1:in require': cannot load such file -- sass/script/node (LoadError)
from /Library/Ruby/Gems/2.0.0/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches/browser_support.rb:1:in'
from /Library/Ruby/Gems/2.0.0/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches.rb:2:in require'
from /Library/Ruby/Gems/2.0.0/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches.rb:2:inblock in '
from /Library/Ruby/Gems/2.0.0/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches.rb:1:in each'
from /Library/Ruby/Gems/2.0.0/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches.rb:1:in'
from /Library/Ruby/Gems/2.0.0/gems/compass-0.12.2/lib/compass/sass_extensions.rb:9:in require'
from /Library/Ruby/Gems/2.0.0/gems/compass-0.12.2/lib/compass/sass_extensions.rb:9:in'
from /Library/Ruby/Gems/2.0.0/gems/compass-0.12.2/lib/compass.rb:5:in require'
from /Library/Ruby/Gems/2.0.0/gems/compass-0.12.2/lib/compass.rb:5:inblock in '
from /Library/Ruby/Gems/2.0.0/gems/compass-0.12.2/lib/compass.rb:4:in each'
from /Library/Ruby/Gems/2.0.0/gems/compass-0.12.2/lib/compass.rb:4:in'
from /Library/Ruby/Gems/2.0.0/gems/compass-0.12.2/bin/compass:20:in require'
from /Library/Ruby/Gems/2.0.0/gems/compass-0.12.2/bin/compass:20:inblock in '
from /Library/Ruby/Gems/2.0.0/gems/compass-0.12.2/bin/compass:8:in fallback_load_path'
from /Library/Ruby/Gems/2.0.0/gems/compass-0.12.2/bin/compass:19:in'
from /usr/bin/compass:23:in load'
from /usr/bin/compass:23:in'
My Ruby Version - ruby 2.0.0p247 (2013-06-27 revision 41674) [universal.x86_64-darwin13] 我的Ruby版本 - ruby 2.0.0p247(2013-06-27修订版41674)[universal.x86_64-darwin13]
My Gemfile 我的Gemfile
source "https://rubygems.org"
gemspec
platform :rbx do
gem 'rubysl', '~> 2.0'
gem 'json', '>= 1.8.1'
gem 'rubysl-test-unit', '~> 2.0'
gem 'racc'
end
My Gemspec 我的Gemspec
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'bootstrap-sass/version'
Gem::Specification.new do |s|
s.name = "bootstrap-sass"
s.version = Bootstrap::VERSION
s.authors = ["Thomas McDonald"]
s.email = 'tom@conceptcoding.co.uk'
s.summary = "Twitter's Bootstrap, converted to Sass and ready to drop into Rails or Compass"
s.homepage = "https://github.com/twbs/bootstrap-sass"
s.license = 'MIT'
s.add_development_dependency 'compass'
s.add_development_dependency 'term-ansicolor'
s.add_development_dependency 'sass-rails', '>= 3.2'
s.add_runtime_dependency 'sass', '~> 3.3.0'
s.add_development_dependency 'capybara'
s.add_development_dependency 'poltergeist'
s.add_development_dependency 'tzinfo'
s.add_development_dependency 'jquery-rails'
s.add_development_dependency 'slim-rails'
s.add_development_dependency 'uglifier'
s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- test/*`.split("\n")
end
If you actually have the bootstrap-sass code checked out, change this line in the .gemspec: 如果您确实已签出bootstrap-sass代码,请在.gemspec中更改此行:
s.add_runtime_dependency 'sass', '~> 3.3.0'
to 至
s.add_runtime_dependency 'sass', '~> 3.2.0'
After this, run bundle update sass
, then bundle clean --force
. 在此之后,运行
bundle update sass
,然后bundle clean --force
。 The problem when downgrading the sass gem is that compass still tries to load the newer one, that's why you need the clean (or you could do a gem uninstall
if it suits you better). 降级sass gem的问题是指南针仍然试图加载新的,这就是你需要干净的原因(或者如果它更适合你你可以做一个
gem uninstall
)。
Install the gem 安装宝石
gem install bootstrap-sass
If you have an existing Compass project: 如果您有一个现有的Compass项目:
# config.rb:
require 'bootstrap-sass'
bundle exec compass install bootstrap
If you are creating a new Compass project, you can generate it with bootstrap-sass support: 如果要创建新的Compass项目,可以使用bootstrap-sass支持生成它:
bundle exec compass create my-new-project -r bootstrap-sass --using bootstrap
This will create a new Compass project with the following files in it: 这将创建一个新的Compass项目,其中包含以下文件:
Some bootstrap-sass mixins may conflict with the Compass ones. 一些bootstrap-sass mixins可能与Compass的冲突。 If this happens, change the import order so that Compass mixins are loaded later.
如果发生这种情况,请更改导入顺序,以便稍后加载Compass mixins。
I would recommend yeoman(bower/grunt) to manage your client side libraries. 我会推荐yeoman(bower / grunt)来管理你的客户端库。 Not only will it download bootstrap with comapss and install it, it will make it easy to update and automatically recompile sass when a file is changed and reload the browser using life reload.
它不仅会下载带有comapss的引导程序并安装它,它还可以让文件更改时自动更新并自动重新编译sass,并使用生活重新加载重新加载浏览器。 It comes with grunt which you can setup to minify js,css and compress svg, png etc.
它带有grunt,你可以设置缩小js,css和压缩svg,png等。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.