hawx / guard-sass

Guard::Sass automatically rebuilds sass files when modified (like sass --watch)
MIT License
88 stars 35 forks source link

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

Closed lynaghk closed 12 years ago

lynaghk commented 12 years ago

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 commented 12 years ago

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 commented 12 years ago

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 commented 12 years ago

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

lynaghk commented 12 years ago

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

hawx commented 12 years ago

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 commented 12 years ago

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

gilligan commented 12 years ago

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

$ bundle show Gems included by the bundle:

$ 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 commented 12 years ago

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

gilligan commented 12 years ago

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

DanielVoogsgerd commented 11 years ago

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:

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 commented 11 years ago

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 commented 11 years ago

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 commented 11 years ago

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 commented 11 years ago

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