我正在使用guard观察文件系统的变化并运行一些脚本。我不熟悉ruby环境。到目前为止,要使用watcher,我只需要安装Shell (没有gem文件)。现在,我也在尝试按照here的说明添加Sass。
我是通过gem install guard-shell安装的
但是,当尝试下一条命令gem 'guard-sass', :require => false时
它会给出错误
$ gem 'guard-sass', :require => false
ERROR: While executing gem ... (RuntimeError)
Unknown command guard-sass,怎么啦?我是否需要一个gem文件(不确定内容应该是什么,或者我为什么需要这个)
guard list
+------------+--------------+
| Available Guard plugins |
+------------+--------------+
| Plugin | In Guardfile |
+------------+--------------+
| Sass | ✘ |
| Shell | ✔ |
+------------+--------------+Guardfile:
guard 'shell' do
watch(/(.*).md/) {`python render.py` }
end编辑:
跳过捆绑器,给出了这个消息。不知道这是什么意思,但是guard init sass没有给我的
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,运行方式如下
bundle exec guard init sass
10:04:31 - ERROR - Could not load 'guard/sass' or '~/.guard/templates/sass' or find class Guard::Sass如上所述,我安装了sass
sudo gem install sass而gemfile看起来像这样:
示例Gemfile
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:
发布于 2013-02-15 22:45:49
如果你重新阅读Github上的指南,你会注意到它说的是将gem 'guard-sass', :require => false添加到你的Gemfile中,而不是在你的终端上运行它。
现在,如果文档是正确的,您所要做的就是运行guard init sass
https://stackoverflow.com/questions/14896751
复制相似问题