Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not load 'guard/rack' #12

Closed
conraddecker opened this issue Jan 16, 2013 · 10 comments
Closed

Could not load 'guard/rack' #12

conraddecker opened this issue Jan 16, 2013 · 10 comments

Comments

@conraddecker
Copy link

Hi,

I'm relatively new to Guard but have a good feel for how it works. I'm attempting to use Guard/Rack, but have been having a tough time getting it working. I've installed the gem, and when I attempt to run 'guard init', I get an error stating: "Could not load 'guard/rack'"

I could very possibly be missing something simple, and if that's the case I apologize in advance. However I did notice that the build status on your Github page is currently showing up as failed. I also noticed there were some commits made only a couple of hours ago so I didn't know if perhaps something broke in the process.

Regardless, any help is certainly appreciated. Please let me know if I can provide any additional information that would be helpful.

Thanks!

@conraddecker
Copy link
Author

Don't know if this helps at all...but when I create the Guardfile manually and run 'bundle exec guard' I get the following error.
Screen Shot 2013-01-15 at 8 50 42 PM

@dblock
Copy link
Owner

dblock commented Jan 16, 2013

Is this a project you can share? Or at least the Gemfile? This error means that you aren't loading guard-rack in your environment, you should have the guard-rack gem in the development section of your Gemfile.

@dblock
Copy link
Owner

dblock commented Jan 16, 2013

Note that build status was a Travis-CI fluke. There was a CHANGELOG.md change since the previous successful build.

@conraddecker
Copy link
Author

Absolutely, would be more then happy to post what I've got.

So, here's my Gemfile

source :rubygems

gem 'sinatra'
gem 'padrino-helpers'

gem 'haml'
gem 'sass'
gem 'coffee-script'
gem 'sprockets'

gem 'json'
gem 'data_mapper'
gem 'dm-zone-types'

gem 'omniauth'
gem 'omniauth-identity'

gem 'dm-mysql-adapter'

group :development, :test do 
  gem 'rb-fsevent', '~> 0.9.1'
  gem 'guard'
  #gem 'growl_notify'
  gem 'ruby_gntp'
  gem "guard-rack"
  gem "guard-livereload"
  gem "rack-livereload"
end

If I run

bundle install

I'm presented with a list of gems that are being used as expected:

Screen Shot 2013-01-15 at 9 31 16 PM

From the same location in the filesystem I then run

bundle exec guard init

I've also tried just guard init thinking that perhaps I was off base with the bundle exec. Both return the same error:

Screen Shot 2013-01-15 at 9 33 14 PM

Is it possible that livereload could be causing trouble here? I'll try removing that gem after I post this and see if I have a different outcome.

As far as the build status, apologies for making note of that...was just unsure if perhaps there was something there worth noting.

Thanks a bunch for the quick response.

@dblock
Copy link
Owner

dblock commented Jan 16, 2013

I need your Guardfile, too.

@conraddecker
Copy link
Author

This is actually happening prior to having a Guardfile...the screenshot for the error that I posted occurs when I'm trying to init the Guardfile.

However, the second error that I received was when I created the Guardfile by hand. Here's what I had in the Guardfile when I received that error:

notification :gntp

guard 'livereload' do 
  watch(%r{views/.+\.(erb|haml|slim)$})
  watch(%r{public/.+\.(css|js|html)})
end

guard 'rack', :port => 9292 do
  watch("config.ru")
  watch('Gemfile.lock')
  watch('application.rb')
  watch(%r{^(models|routes)/.*})
end

@dblock
Copy link
Owner

dblock commented Jan 16, 2013

Yeah. I think I got it. Does adding gem "ffi" into your Gemfile before guard-rack help?

@conraddecker
Copy link
Author

Yes sir, it sure does. Once I added that into the Gemfile I no longer receive the error messages and it looks like everything is working as expected! Beautiful, thanks a ton for your help.

Is there any additional information that I could provide that would be helpful for you in any way?

@dblock dblock closed this as completed in b45b695 Jan 16, 2013
@dblock
Copy link
Owner

dblock commented Jan 16, 2013

Thanks for reporting the bug and your help. I pushed 1.3.1 that has a permanent fix - you can bundle update guard-rack and remove gem "ffi" if you want.

Long story short, guard-rack uses a gem called spoon to spawn processes, which uses ffi, but doesn't properly declare that dependency via its .gemspec. So we have to in guard-rack.

@conraddecker
Copy link
Author

Awesome, glad to have been able to help.

Thanks for the explanation, will be sure to update everything accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants