【问题标题】:Bundler SASS error with gem filesgem 文件的 Bundler SASS 错误
【发布时间】:2014-03-19 21:15:23
【问题描述】:

在一个新项目中遇到这个错误 - 这让我发疯!

这是一个试图找出所有这些东西的雷区,天哪,一旦我把这个整理好,我会做一个简单的遵循指南!!

请帮忙

Bundler could not find compatible versions for gem "sass":
  In Gemfile:
    singularitygs (~> 1.2.0) ruby depends on
      sass (~> 3.3.0) ruby

compass (~> 0.12.3) ruby depends on
  sass (3.2.14)

我的宝石文件

# A sample Gemfile
source "https://rubygems.org"

# gem "rails"
gem "compass", "~> 0.12.3"
gem "singularitygs", "~> 1.2.0"
gem "singularity-extras", "~> 0.0.3"
gem "breakpoint", "~> 2.4.2"
gem "jacket", "~> 1.1.1"
gem "toolkit", "~> 2.0.1"
gem "bourbon", "~> 3.1.8"

这是我 Mac 上的宝石

$ 宝石列表

* 本地宝石 *

actionmailer (4.0.4)
actionpack (4.0.4)
activemodel (4.0.4)
activerecord (4.0.4)
activerecord-deprecated_finders (1.0.3)
activesupport (4.0.4, 3.2.17)
arel (4.0.2)
atomic (1.1.16)
bigdecimal (1.2.5, 1.2.0)
bourbon (3.1.8)
breakpoint (2.4.2)
builder (3.1.4)
bundler (1.5.3)
celluloid (0.15.2)
celluloid-io (0.15.0)
chunky_png (1.3.0)
coffee-script (2.2.0)
coffee-script-source (1.7.0)
compass (1.0.0.alpha.19, 0.12.3)
compass-core (1.0.0.alpha.19)
compass-import-once (1.0.4, 1.0.3)
erubis (2.7.0)
execjs (2.0.2, 1.4.0)
ffi (1.9.3)
fssm (0.2.10)
haml (4.0.5)
hike (1.2.3)
i18n (0.6.9)
io-console (0.4.2)
jacket (1.1.1)
json (1.8.1, 1.7.7)
kramdown (1.3.3, 1.3.2)
listen (2.7.1, 1.1.6)
mail (2.5.4)
middleman (3.2.2)
middleman-core (3.2.2)
middleman-sprockets (3.3.1)
mime-types (1.25.1)
minitest (5.3.1, 4.3.2)
modular-scale (2.0.4)
multi_json (1.9.0)
nio4r (1.0.0)
polyglot (0.3.4)
psych (2.0.4, 2.0.0)
rack (1.5.2)
rack-test (0.6.2)
rails (4.0.4)
railties (4.0.4)
rake (10.1.1, 0.9.6)
rb-fsevent (0.9.4)
rb-inotify (0.9.3)
rb-kqueue (0.2.2)
rdoc (4.1.1, 4.0.0)
sass (3.3.3, 3.3.1, 3.2.14)
sassy-maps (0.3.2)
sassy-math (1.5)
singularity-extras (0.0.3)
singularitygs (1.2.0)
sprockets (2.12.0)
sprockets-helpers (1.1.0, 1.0.1)
sprockets-rails (2.0.1)
sprockets-sass (1.0.3)
susy (2.1.1, 1.0.9)
test-unit (2.5.5, 2.0.0.0)
thor (0.18.1)
thread_safe (0.2.0)
tilt (2.0.0, 1.4.1)
timers (1.1.0)
toolkit (2.0.1)
treetop (1.4.15)
tzinfo (0.3.39)
uglifier (2.5.0, 2.4.0)

好的,我想我已经到了那里,但仍然遇到一些错误

我的 config.rb 文件

require 'compass/import-once/activate'
require 'singularitygs'
require 'singularity-extras'
require 'breakpoint'
require 'jacket'
require 'toolkit'
require 'bourbon'


# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "css"
sass_dir = "sass"
images_dir = "img".
fonts_dir = "fonts"
javascripts_dir = "js"

# You can select your preferred output style here (can be overridden via the command line):
output_style = :compact 

# To enable relative paths to assets via compass helper functions. Uncomment:
relative_assets = true

# To disable debugging comments that display the original location of your selectors. Uncomment:
# line_comments = false


# If you prefer the indented syntax, you might want to regenerate this
# project again passing --syntax sass, or you can uncomment this:
preferred_syntax = :sass
# and then run:
# sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass

我的 app.sass 文件

@import "compass"
@import "singularitygs"
@import "singularity-extras"
@import "breakpoint"
@import "jacket"
@import "toolkit"
@import "bourbon"
// My sass
@import "partials/normalize"

我的 Gemfile 文件

来源“https://rubygems.org

gem "compass"
gem "singularitygs"
gem "singularity-extras"
gem "breakpoint"
gem "jacket"
gem "toolkit"
gem "bourbon"

错误

  error sass/app.sass (Line 2: File to import not found or unreadable: jacket.
Load paths:
  /Applications/MAMP/htdocs/MachuPicchuMobile.com/7DayShapeUp/sass
  /Users/nathanielharman/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/compass-core-1.0.0.alpha.19/stylesheets
  /Users/nathanielharman/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/susy-2.1.1/sass
  Compass::SpriteImporter)
overwrite css/app.css
     info sass/app.sass was modified
    error sass/app.sass (Line 2: File to import not found or unreadable: jacket.
Load paths:
  /Applications/MAMP/htdocs/MachuPicchuMobile.com/7DayShapeUp/sass
  /Users/nathanielharman/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/compass-core-1.0.0.alpha.19/stylesheets
  /Users/nathanielharman/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/susy-2.1.1/sass
  Compass::SpriteImporter)
identical css/app.css
     info sass/app.sass was modified
    error sass/app.sass (Line 2: File to import not found or unreadable: singularitygs.
Load paths:
  /Applications/MAMP/htdocs/MachuPicchuMobile.com/7DayShapeUp/sass
  /Users/nathanielharman/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/compass-core-1.0.0.alpha.19/stylesheets
  /Users/nathanielharman/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/susy-2.1.1/sass
  Compass::SpriteImporter)
overwrite css/app.css

【问题讨论】:

  • 你使用的是哪个 Rails 版本
  • 4.0.4 就我所见

标签: ruby gem sass bundler


【解决方案1】:

另外,bundle update 一次只允许您更新一个 gem,如果您要更新到 Rails 4 并且必须同时更新大量 gem,这会很困难。

我通过删除Gemfile.lock 并执行bundle install 解决了这个问题。

删除 Gemfile 中的版本号,然后尝试 bundle update

【讨论】:

  • 我刚刚运行了包更新,它给出了与上面相同的错误
  • 我也没有 .lock 文件,我不知道为什么?对不起,我完全迷路了:(
  • 你试过删除Gemfile.lock
  • @NathanielHarman 删除 Gemfile 中的版本号,然后尝试更新包。
  • 我想我到了 - 感谢您的帮助,我刚刚用新错误更新了我的问题
猜你喜欢
  • 1970-01-01
  • 2011-02-15
  • 2016-08-26
  • 1970-01-01
  • 2017-04-18
  • 2015-10-29
  • 2011-03-28
  • 2013-01-31
  • 1970-01-01
相关资源
最近更新 更多