导入未找到或不可读:断点

时间:2014-03-06 01:30:31

标签: sass susy-compass breakpoint-sass

刚刚安装了断点并尝试在现有的博客项目(html / css / js / php)上使用。目前正在使用Sass和Susy进行基本的网格工作,但是想让Breakpoint尝试这个项目,因为我最近意识到它的易用性和灵活性。

安装成功后,将以下内容添加到我的项目中:

require 'breakpoint'到config.rb文件

@import "breakpoint" 到sass中的_base文件。

刷新后在浏览器中显示此错误消息:

Syntax error: File to import not found or unreadable: breakpoint.\A Load paths:\A /Users/pbj/Desktop/code/the-start/themes/thestart/sass\A /Library/Ruby/Gems/2.0.0/gems/compass-0.12.3/frameworks/blueprint/stylesheets\A /Library/Ruby/Gems/2.0.0/gems/compass-0.12.3/frameworks/compass/stylesheets\A /Library/Ruby/Gems/2.0.0/gems/susy-1.0.9/sass\A Compass::SpriteImporter\A on line 6 of /Users/pbj/Desktop/code/the-start/themes/thestart/sass/_base.scss\A from line 5 of /Users/pbj/Desktop/code/the-start/themes/thestart/sass/screen.scss\A \A 1: /Users/pbj/Desktop/code/the-start/themes/thestart/sass/screen.scss"

在命令行中也出现此错误:

Errno::EACCES on line ["1143"] of /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb: Permission denied - /Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.0.alpha.17/stylesheets/.listen_test Run with --trace to see the full backtrace

运行完整的回溯后,我在命令行中得到了这个:

Errno::EACCES on line ["1143"] of /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb: Permission denied - /Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.0.alpha.17/stylesheets/.listen_test /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1143:in open' /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1143:inrescue in block in touch' /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1139:in block in touch' /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1137:ineach' /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1137:in touch' /Library/Ruby/Gems/2.0.0/gems/listen-1.1.6/lib/listen/adapter.rb:221:inworks?' /Library/Ruby/Gems/2.0.0/gems/listen-1.1.6/lib/listen/adapter.rb:182:in block in usable_and_works?' /Library/Ruby/Gems/2.0.0/gems/listen-1.1.6/lib/listen/adapter.rb:182:ineach' /Library/Ruby/Gems/2.0.0/gems/listen-1.1.6/lib/listen/adapter.rb:182:in all?' /Library/Ruby/Gems/2.0.0/gems/listen-1.1.6/lib/listen/adapter.rb:182:inusable_and_works?' /Library/Ruby/Gems/2.0.0/gems/listen-1.1.6/lib/listen/adapter.rb:49:in block in select_and_initialize' /Library/Ruby/Gems/2.0.0/gems/listen-1.1.6/lib/listen/adapter.rb:47:ineach' /Library/Ruby/Gems/2.0.0/gems/listen-1.1.6/lib/listen/adapter.rb:47:in select_and_initialize' /Library/Ruby/Gems/2.0.0/gems/listen-1.1.6/lib/listen/listener.rb:272:ininitialize_adapter' /Library/Ruby/Gems/2.0.0/gems/listen-1.1.6/lib/listen/listener.rb:264:in setup' /Library/Ruby/Gems/2.0.0/gems/listen-1.1.6/lib/listen/listener.rb:64:instart!' /Library/Ruby/Gems/2.0.0/gems/compass-1.0.0.alpha.18/lib/compass/watcher/project_watcher.rb:31:in watch!' /Library/Ruby/Gems/2.0.0/gems/compass-1.0.0.alpha.18/lib/compass/commands/watch_project.rb:48:inperform' /Library/Ruby/Gems/2.0.0/gems/compass-1.0.0.alpha.18/lib/compass/commands/base.rb:18:in execute' /Library/Ruby/Gems/2.0.0/gems/compass-1.0.0.alpha.18/lib/compass/commands/project_base.rb:19:inexecute' /Library/Ruby/Gems/2.0.0/gems/compass-1.0.0.alpha.18/lib/compass/exec/sub_command_ui.rb:43:in perform!' /Library/Ruby/Gems/2.0.0/gems/compass-1.0.0.alpha.18/lib/compass/exec/sub_command_ui.rb:15:inrun!' /Library/Ruby/Gems/2.0.0/gems/compass-1.0.0.alpha.18/bin/compass:30:in block in <top (required)>' /Library/Ruby/Gems/2.0.0/gems/compass-1.0.0.alpha.18/bin/compass:44:incall' /Library/Ruby/Gems/2.0.0/gems/compass-1.0.0.alpha.18/bin/compass:44:in <top (required)>' /usr/bin/compass:23:inload' /usr/bin/compass:23:in `'

当我安装断点时,它还安装了:

  • SASS-3.3.0.rc.6
  • 罗盘1.0.0.alpha.18
  • 断点-2.4.1

当我检查当前版本的sass时,它是sass-3.3.0.rc.6。

不确定到底发生了什么。我确实读过类似的问题,其中解决方案是在config.rb文件的父目录上调用open' /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1143:in,或者在那个范围内。仍然以相同的错误结束。

编辑:当注释掉断点以尝试向前移动而不使用(暂时)此错误将在浏览器中抛出:

block in touch' /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1137:in

命令行中出现此错误: touch' /Library/Ruby/Gems/2.0.0/gems/listen-1.1.6/lib/listen/adapter.rb:221:in

想到这是因为它试图使用v3.3?

任何人都对如何解决问题有一些建议?

目前正在运行15“MBPr OSX v.10.9.2(Mavericks)

2 个答案:

答案 0 :(得分:4)

你的困境的答案是Bundler! Bundler会将您的项目锁定到特定的宝石中,并确保它们可供使用。如果您正在使用Susy 1.x并且想要使用Breakpoint,那么您的Gemfile应如下所示:

source 'http://rubygems.org' gem 'sass', '~>3.2.0' gem 'compass', '~>0.12.0' gem 'susy', '~>1.0.0' gem 'breakpoint', '~>2.0.0'

但是,如果您想使用最新的和最好的,您的Gemfile应如下所示:

source 'http://rubygems.org' gem 'sass', '~>3.3.0.rc.3' gem 'compass', '~>1.0.0.alpha.18' gem 'susy', '~>2.0.0.rc.2' gem 'breakpoint', '~>2.4.0'

请记住bundle install并通过bundle execbundle exec compass watch

运行Compass编译

答案 1 :(得分:0)

我在通过 npm 安装断点时遇到了同样的问题,我通过 npm install breakpoint-sass 修复了它,然后像这样将它导入到我的 app.scss@import '~/node_modules/breakpoint-sass/stylesheets/breakpoint';

将此代码用于响应式布局:

.class-name {

    **@include breakpoint(max-width 800px) {
     ...
    }**

}