rocket-rentals / redmine-gitosis

A Redmine plugin which manages your gitosis configuration based on your projects and memberships in Redmine. Includes Public Key management views (extracted from http://plan.io).
http://plan.io
161 stars 107 forks source link

'Undefined method 'gitosis_public_keys'", redmine 1.0.0 #10

Open grossws opened 14 years ago

grossws commented 14 years ago

Platform: GNU/Linux, ruby 1.8.7, rails 2.3.5, redmine 1.0.0, postgresql-8.4

On link from profile (http://localhost:3000/my/public_keys) I get such error: "undefined method `gitosis_public_keys' for #User:0x7f220c19a958"

Little part of a traceback: /home/srv/redmine/vendor/rails/activerecord/lib/active_record/attribute_methods.rb:260:in method_missing' /home/srv/redmine/vendor/plugins/redmine_gitosis/app/controllers/gitosis_public_keys_controller.rb:17:inindex'

Migration was successful, gitosis_public_keys table was created.

I tried some other methods, as gitosis_public_keys/new. It creates entry in db, but after that redirects to http://localhost:3000/my/public_keys, and crashes.

ajf commented 14 years ago

It seems the Association isn't being added to the User model.

grossws commented 14 years ago

And how to create such Association? I don't understand Rails so much(

ajf commented 14 years ago

Are you running in development mode or production?

ajf commented 14 years ago

Well It looks like it's the same problem as here: http://www.ruby-forum.com/topic/166578

You need to be running in production mode for it to work since in development, this plugin doesn't get reloaded on subsequent calls. If you restart apache/mongrel/webrick it will work for the first request. Subsequent requests will fail.

I also used http://github.com/mattmeng/redmine_gitosis instead of this branch as the other branch seems to be actively developed.