首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Guard Sass - gem文件

Guard Sass - gem文件
EN

Stack Overflow用户
提问于 2013-02-15 22:23:27
回答 1查看 1.1K关注 0票数 1

我正在使用guard观察文件系统的变化并运行一些脚本。我不熟悉ruby环境。到目前为止,要使用watcher,我只需要安装Shell (没有gem文件)。现在,我也在尝试按照here的说明添加Sass。

我是通过gem install guard-shell安装的

但是,当尝试下一条命令gem 'guard-sass', :require => false

它会给出错误

代码语言:javascript
复制
$ gem 'guard-sass', :require => false
ERROR:  While executing gem ... (RuntimeError)
    Unknown command guard-sass,

怎么啦?我是否需要一个gem文件(不确定内容应该是什么,或者我为什么需要这个)

代码语言:javascript
复制
guard list
+------------+--------------+
|  Available Guard plugins  |
+------------+--------------+
| Plugin     | In Guardfile |
+------------+--------------+
| Sass       | ✘          |
| Shell      | ✔          |
+------------+--------------+

Guardfile:

代码语言:javascript
复制
guard 'shell' do
  watch(/(.*).md/) {`python render.py` }
end

编辑:

跳过捆绑器,给出了这个消息。不知道这是什么意思,但是guard init sass没有给我的

代码语言:javascript
复制
    guard init sass
10:03:05 - INFO - Guard here! It looks like your project has a Gemfile, yet you are running
> [#] `guard` outside of Bundler. If this is your intent, feel free to ignore this
> [#] message. Otherwise, consider using `bundle exec guard` to ensure your
> [#] dependencies are loaded correctly.
> [#] (You can run `guard` with --no-bundler-warning to get rid of this message.)
10:03:05 - ERROR - Could not load 'guard/sass' or '~/.guard/templates/sass' or find class Guard::Sass

添加了一个gemfile,运行方式如下

代码语言:javascript
复制
bundle exec guard init sass
10:04:31 - ERROR - Could not load 'guard/sass' or '~/.guard/templates/sass' or find class Guard::Sass

如上所述,我安装了sass

代码语言:javascript
复制
sudo gem install sass

而gemfile看起来像这样:

示例Gemfile

代码语言:javascript
复制
source "https://rubygems.org"
# gem "rails"
group :development do
  gem 'guard'
  gem "sass"
  gem 'guard-sass', :require => false     
end
gem 'rb-fsevent', '~> 0.9.1'

编辑2:

这是权限问题,请参阅https://github.com/hawx/guard-sass/issues/29

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-02-15 22:45:49

如果你重新阅读Github上的指南,你会注意到它说的是将gem 'guard-sass', :require => false添加到你的Gemfile中,而不是在你的终端上运行它。

现在,如果文档是正确的,您所要做的就是运行guard init sass

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14896751

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档