Could not load 'guard/sass' or find class Guard::Sass #29

Closed
lynaghk opened this Issue Jun 3, 2012 · 14 comments

Projects

None yet

5 participants

@lynaghk
lynaghk commented Jun 3, 2012

I'm using Guard in a non-Rails project under Bundler 1.1.4 with guard-sass 0.7.0.
Running bundle exec guard gives the following:

ERROR: Could not load 'guard/sass' or find class Guard::Sass
ERROR: cannot load such file -- guard/sass
ERROR: Invalid Guardfile, original error is:
undefined method `new' for nil:NilClass
ERROR: No guards found in Guardfile, please add at least one.

Under guard-sass 0.6.0 the error is

/usr/lib/ruby/gems/1.9.1/gems/guard-sass-0.6.0/lib/guard/sass.rb:48:in `initialize': cannot load such file -- guard/sass/runner (LoadError)
        from /usr/lib/ruby/gems/1.9.1/gems/guard-1.1.0/lib/guard.rb:279:in `new'
        from /usr/lib/ruby/gems/1.9.1/gems/guard-1.1.0/lib/guard.rb:279:in `add_guard'
        from /usr/lib/ruby/gems/1.9.1/gems/guard-1.1.0/lib/guard/dsl.rb:388:in `guard'

but everything works fine under guard-sass 0.5.4.

This is on ruby 1.9.3p0 on Linux.

@hawx
Owner
hawx commented Jun 4, 2012

I think this is going to end up being a Linux issue of some kind. Could you download this test I put together, bundle install then bundle exec guard and see if it works.

@lynaghk
lynaghk commented Jun 4, 2012

Thanks for the custom test.
Here's the output:

ERROR: Could not load 'guard/sass' or find class Guard::Sass
ERROR: cannot load such file -- guard/sass
ERROR: Invalid Guardfile, original error is:
undefined method `new' for nil:NilClass
ERROR: No guards found in Guardfile, please add at least one.
Guard uses NotifySend to send notifications.
Guard is now watching at '/home/kevin/Downloads/sass-test'> 

(Note: I've upgraded to 1.9.3p125 in the mean time.)

@hawx
Owner
hawx commented Jun 5, 2012

Do other guards (guard-rspec for instance) have the same problem. Issue #8 on guard-shell seems to be related to this.

@lynaghk
lynaghk commented Jun 5, 2012

The only guards I've used are livereload, haml, jasmine, and coffeescript. None of them have this issue.

@hawx
Owner
hawx commented Jun 6, 2012

I think I've fixed the problem. The file permissions were incorrect for almost every file, so I've fixed them and pushed a new version of the gem (0.7.1), can you try it out and tell me if that fixes your problem. Thanks.

@lynaghk
lynaghk commented Jun 6, 2012

Confirmed; version 0.7.1 works great. Thanks for your help on this one!

@lynaghk lynaghk closed this Jun 6, 2012
@gilligan
gilligan commented Oct 8, 2012

I am having the exact same problem with guard-sass 1.0.0 :

$ bundle show
Gems included by the bundle:

  • addressable (2.3.2)
  • bundler (1.0.15)
  • em-websocket (0.3.8)
  • eventmachine (1.0.0)
  • ffi (1.1.0)
  • guard (1.4.0)
  • guard-jshint-node (0.0.6)
  • guard-livereload (1.0.1)
  • guard-sass (1.0.0)
  • listen (0.5.3)
  • multi_json (1.3.6)
  • rb-fsevent (0.9.2)
  • rb-inotify (0.8.8)
  • sass (3.2.1)
  • terminal-notifier-guard (1.5.3)
  • thor (0.16.0)

$ bundle guard init sass
ERROR: Could not load 'guard/sass' or '~/.guard/templates/sass' or find class Guard::Sass

$ bundle exec guard
ERROR: Could not load 'guard/sass' or find class Guard::Sass
ERROR: no such file to load -- guard/sass
ERROR: Invalid Guardfile, original error is:
undefined method `new' for nil:NilClass

ruby 1.8.7 / ubuntu

@ghost
ghost commented Oct 8, 2012

Try to change permissions on /var/lib/gems/ to 755

@gilligan
gilligan commented Oct 8, 2012

@it-consulting-lorenz that did indeed solve it. Thanks

@DanielVoogsgerd

I'm getting this issue on 1.0.5 since yesterday (22-04-13). When loading the 1.0.4 version the issue resolves.

I'm quite busy right now so I can't post any details about my bundle using 1.0.5, but I can post some details about 1.0.4

$ bundle show
Gems included by the bundle:

  • bundler (1.3.5)
  • coderay (1.0.9)
  • coffee-script (2.2.0)
  • coffee-script-source (1.6.2)
  • em-websocket (0.5.0)
  • eventmachine (1.0.3)
  • execjs (1.4.0)
  • ffi (1.7.0)
  • formatador (0.2.4)
  • guard (1.8.0)
  • guard-coffeescript (1.3.0)
  • guard-concat (0.0.3)
  • guard-livereload (1.3.0)
  • guard-sass (1.0.4)
  • guard-uglify (0.1.0)
  • http_parser.rb (0.5.3)
  • listen (1.0.2)
  • lumberjack (1.0.3)
  • method_source (0.8.1)
  • multi_json (1.7.2)
  • pry (0.9.12.1)
  • rb-fsevent (0.9.3)
  • rb-inotify (0.9.0)
  • rb-kqueue (0.2.0)
  • sass (3.2.8)
  • slop (3.4.4)
  • thor (0.18.1)
  • uglifier (2.0.1)

And the error was exactly the same as the one gilligan had:
$ bundle guard init sass
ERROR: Could not load 'guard/sass' or '~/.guard/templates/sass' or find class Guard::Sass

$ bundle exec guard
ERROR: Could not load 'guard/sass' or find class Guard::Sass
ERROR: no such file to load -- guard/sass
ERROR: Invalid Guardfile, original error is:
undefined method `new' for nil:NilClass

@hawx
Owner
hawx commented Apr 23, 2013

Seems that when I merged the last pull request it changed the file permissions, again. I've pushed 1.0.6 with the correct permissions.

@blitux
blitux commented Jun 22, 2013

I've updated to 1.3.1 and I'm having the same issue.

The files importer.rb and runner.rb had 660 permissions. I've updated the permissions to 644 and now it works.

@hawx
Owner
hawx commented Jun 23, 2013

Fixed by v1.3.2 I've just pushed. Out of interest did you install this gem with sudo, or install ruby with sudo?

@blitux
blitux commented Jun 25, 2013

I've installed the gem with: sudo gem install guard-sass

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment