指南针框架无法加载/找到"奇点"框架/扩展:
我通过 RubyGem 安装了软件包:
gem list compass && gem list singularity && gem list breakpoint
这给了我以下信息:
*** LOCAL GEMS ***
compass (1.0.0.alpha.18)
compass-core (1.0.0.alpha.17)
compass-import-once (1.0.2)
*** LOCAL GEMS ***
singularitygs (1.1.2)
*** LOCAL GEMS ***
breakpoint (2.4.1)
我的 Gruntfile 的任务compass:dev
:
compass:
dev:
options:
trace: true
require: ['singularitygs']
sassDir: '<%= dir.sass %>'
cssDir: '<%= dir.css %>'
environment: 'development'
结果:
Running "compass:dev" (compass) task
LoadError on line 51 of /Library/Ruby/Site/1.8/rubygems/core_ext/kernel_require.rb: no such file to load -- singularitygs
Run with --trace to see the full backtrace
Warning: ↑ Use --force to continue.
Aborted due to warnings.
接下来,我尝试了一个config.rb
文件:
compass:
dev:
options:
trace: true
config: 'config.rb'
sassDir: '<%= dir.sass %>'
cssDir: '<%= dir.css %>'
environment: 'development'
包含以下内容:
require 'singularitygs'
仅此而已,结果如下:
Running "compass:dev" (compass) task
LoadError on line 51 of /Library/Ruby/Site/1.8/rubygems/core_ext/kernel_require.rb: no such file to load -- singularitygs
/Library/Ruby/Site/1.8/rubygems/core_ext/kernel_require.rb:51:in `require'
/Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/configuration/data.rb:161:in `require'
config.rb:1:in `get_binding'
/Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/configuration/serialization.rb:20:in `get_binding'
/Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/configuration/serialization.rb:23:in `parse_string'
/Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/configuration/serialization.rb:15:in `_parse'
/Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/configuration/serialization.rb:14:in `open'
/Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/configuration/serialization.rb:14:in `_parse'
/Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/configuration/file_data.rb:7:in `new_from_file'
/Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/configuration/inheritance.rb:204:in `with_defaults'
/Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/configuration/file_data.rb:6:in `new_from_file'
/Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/configuration/helpers.rb:42:in `configuration_for'
/Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/configuration/helpers.rb:97:in `add_project_configuration'
/Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/commands/project_base.rb:31:in `add_project_configuration'
/Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/commands/project_base.rb:25:in `configure!'
/Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/commands/project_base.rb:15:in `initialize'
/Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/commands/update_project.rb:37:in `initialize'
/Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/exec/sub_command_ui.rb:42:in `new'
/Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/exec/sub_command_ui.rb:42:in `perform!'
/Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/exec/sub_command_ui.rb:15:in `run!'
/Library/Ruby/Gems/1.8/gems/compass-0.12.2/bin/compass:30
/Library/Ruby/Gems/1.8/gems/compass-0.12.2/bin/compass:44:in `call'
/Library/Ruby/Gems/1.8/gems/compass-0.12.2/bin/compass:44
/usr/bin/compass:23:in `load'
/usr/bin/compass:23
Warning: ↑ Use --force to continue.
Aborted due to warnings.
因此,我检查了指南针是否在另一个目录中compass frameworks --trace
了该框架:
Available Frameworks & Patterns:
* blueprint
- blueprint/basic - A basic blueprint install that mimics the actual blueprint css.
- blueprint/buttons - Button Plugin
- blueprint/link_icons - Icons for common types of links
- blueprint/project - The blueprint framework.
- blueprint/semantic - The blueprint framework for use with semantic markup.
* compass
- compass/ellipsis - Plugin for cross-browser ellipsis truncated text.
- compass/extension - Generate a compass extension.
- compass/pie - Integration with http://css3pie.com/
- compass/project - The default project layout.
如果我compass frameworks --trace
config.rb
文件所在的根目录中执行相同的命令,我将收到相同的错误:
LoadError on line 51 of /Library/Ruby/Site/1.8/rubygems/core_ext/kernel_require.rb: no such file to load -- singularitygs
/Library/Ruby/Site/1.8/rubygems/core_ext/kernel_require.rb:51:in `require'
/Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/configuration/data.rb:161:in `require'
/Users/darius/Code/www/voidplus.de/www/config.rb:1:in `get_binding'
/Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/configuration/serialization.rb:20:in `get_binding'
/Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/configuration/serialization.rb:23:in `parse_string'
/Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/configuration/serialization.rb:15:in `_parse'
/Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/configuration/serialization.rb:14:in `open'
/Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/configuration/serialization.rb:14:in `_parse'
/Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/configuration/file_data.rb:7:in `new_from_file'
/Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/configuration/inheritance.rb:204:in `with_defaults'
/Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/configuration/file_data.rb:6:in `new_from_file'
/Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/configuration/helpers.rb:42:in `configuration_for'
/Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/configuration/helpers.rb:97:in `add_project_configuration'
/Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/commands/project_base.rb:31:in `add_project_configuration'
/Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/commands/project_base.rb:25:in `configure!'
/Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/commands/project_base.rb:15:in `initialize'
/Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/commands/list_frameworks.rb:7:in `initialize'
/Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/exec/sub_command_ui.rb:42:in `new'
/Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/exec/sub_command_ui.rb:42:in `perform!'
/Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/exec/sub_command_ui.rb:15:in `run!'
/Library/Ruby/Gems/1.8/gems/compass-0.12.2/bin/compass:30
/Library/Ruby/Gems/1.8/gems/compass-0.12.2/bin/compass:44:in `call'
/Library/Ruby/Gems/1.8/gems/compass-0.12.2/bin/compass:44
/usr/bin/compass:23:in `load'
/usr/bin/compass:23
我不知道,我能尝试什么来解决这个问题。此外,我卸载并安装了所有 gem 文件,但没有成功。也许是错误的宝石环境gem env
?
- RUBYGEMS VERSION: 2.2.2
- RUBY VERSION: 2.0.0 (2013-06-27 patchlevel 247) [x86_64-darwin12.4.0]
- INSTALLATION DIRECTORY: /usr/local/Cellar/ruby/2.0.0-p247/lib/ruby/gems/2.0.0
- RUBY EXECUTABLE: /usr/local/Cellar/ruby/2.0.0-p247/bin/ruby
- EXECUTABLE DIRECTORY: /usr/local/Cellar/ruby/2.0.0-p247/bin
感谢您的任何帮助和提示,大流士
点1.1.2与Compass 1.0.0不兼容。不过,我们有一个Singularity 1.2.0的预发布版本。
Gem兼容性问题正是我们建议使用 Bundler 来管理 Gem 版本的原因。如果要将奇点与指南针 1.0.0 一起使用,请执行以下操作:
-
(sudo) gem install bundler
在项目的根目录中创建一个文件
Gemfile
,并添加以下内容:source 'http://rubygems.org' gem 'singularitygs', '~>1.2.0.rc.6'
运行
bundle install --path vendor
- 忽略版本控制系统中的
vendor
目录(如果使用 Git,请将./vendor
添加到.gitignore
文件中) - 将
bundleExec: true
添加到您的compass:dev
咕噜咕噜的任务
我通过rbenv
将Ruby从2.0.0
降级到1.9.3
,这解决了问题。