bsr
bsr

Reputation: 58712

Guard Sass - gem file

I am using guard to watch filesystem change and run some script. I am not familiar with ruby environment. So far, to use watcher, I only needed to install Shell (No gem file). Now, I am trying to add Sass as well, following the instruction here.

I installed it through gem install guard-shell

But, when try the next command gem 'guard-sass', :require => false

it gives error

$ gem 'guard-sass', :require => false
ERROR:  While executing gem ... (RuntimeError)
    Unknown command guard-sass,

what is wrong? Do I need a gem file (not sure what should be the content, or why I need this)

guard list
+------------+--------------+
|  Available Guard plugins  |
+------------+--------------+
| Plugin     | In Guardfile |
+------------+--------------+
| Sass       | ✘          |
| Shell      | ✔          |
+------------+--------------+

Guardfile:

guard 'shell' do
  watch(/(.*).md/) {`python render.py` }
end

EDIT:

skipping the bundler, gave this message. Not sure what are the implication, but guard init sass didn't add anything to my

    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

Added a gemfile, and run like

bundle exec guard init sass
10:04:31 - ERROR - Could not load 'guard/sass' or '~/.guard/templates/sass' or find class Guard::Sass

As mentioned above I installed sass

sudo gem install sass

and gemfile looks like:

A sample 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'

EDIT 2:

It was permission issue, see https://github.com/hawx/guard-sass/issues/29

Upvotes: 1

Views: 1130

Answers (1)

james246
james246

Reputation: 1904

If you re-read the guide on Github, you'll notice it says to add gem 'guard-sass', :require => false to your Gemfile, not run it in your terminal.

Now, if the documentation is correct, all you have to do it run guard init sass

Upvotes: 1

Related Questions