ranmocy / guard-rails

Guard-Rails is watching on your development servers as you wish!
http://ranmocy.github.com/guard-rails
MIT License
137 stars 25 forks source link

The dependency on version is incompatible with paper_trails version class #2

Closed mhenrixon closed 11 years ago

mhenrixon commented 11 years ago

All of a sudden (after upgrading guard-rails) to latest version we get the following errors

Started GET "/" for 127.0.0.1 at 2013-02-25 11:25:13 +0100
Processing by PagesController#show as HTML
  Site Load (0.3ms)  SELECT "sites".* FROM "sites" WHERE "sites"."subdomain" = 'dev' LIMIT 1
  Page Load (0.3ms)  SELECT "pages".* FROM "pages" WHERE "pages"."site_id" = 1 AND "pages"."url" = '' LIMIT 1
  Version Load (0.4ms)  SELECT "versions".* FROM "versions" WHERE "versions"."item_id" = 1 AND "versions"."item_type" = 'Page' AND "versions"."published_at" = '2013-02-21 17:30:23.241998' ORDER BY created_at ASC, id ASC LIMIT 1
Completed 500 Internal Server Error in 6ms

NoMethodError (protected method `[]' called for "":Version):
  app/models/concerns/versionable.rb:69:in `published_version'
  app/controllers/pages_controller.rb:9:in `show'
  app/controllers/application_controller.rb:172:in `set_logger_site_id'
  app/controllers/application_controller.rb:178:in `set_logger_username'
ranmocy commented 11 years ago

@mhenrixon Check the latest version 0.3.3 which move Version gem dependency from runtime to development.

mhenrixon commented 11 years ago

The 0.3.4 version don't have that problem but if I upgrade I can't use pry anymore because guard-rails messes up readline somehow. With the previous version of 0.2.3 pry doesn't break when it hits binding.pry.

Guess I can't use guard-rails for debugging?

ranmocy commented 11 years ago

I don't get it :( Since I use it all day long with pry for debugging, very rarely to get the issue you said. And only when something fatal occurred(such as Rails process breaks down). Every time I just simply reset the terminal and restart the guard to fix it.

The readline maybe is messed up by Rails output, not guard-rails. So I think maybe I should silent the Rails standard output by adding a new switcher?

ranmocy commented 11 years ago

Since the readline issue is another problem, close it for now. If you still have the same problem, please create a new issue in details instead, thanks.