Tuesday, November 11, 2008

Rails "Plugin not found" error may be a red herring.

I've been writing a number of plugins lately, and I kept getting this error when I would install it from RubyForge:

Plugin not found: ["http://blah.rubyforge.org/svn/trunk/vendor/plugins/blah"]

I knew the plugin was there, and in fact I could see that the plugin files were being placed in the vendor/plugins directory. So why was this message showing up?

After a number of hours (yes, hours, it's depressing) it turned out that I had an error in my plugin's install.rb file. Apparently any exception raised in a plugin's install.rb file gets caught and the erroneous "Plugin not found:" message is shown.

So, if you see this error and are confused, start adding traces to your install.rb file and you are likely to find something is broken.

Wednesday, November 05, 2008

Thwarted by ActionController::MethodNotAllowed

Are you running a rails app locally seeing this:



ActionController::MethodNotAllowed
Only get and post requests are allowed.
RAILS_ROOT: /Users/me/my_rails_project
ActionController::MethodNotAllowed (Only get and post requests are allowed.)



There are of course actual valid reasons this might be happening to you if you're doing something tricky, but if all you're trying to do is browse to a page (which is get request) and it's blowing up with this there may be a simple fix.

Stop script/server and start it again. Then refresh the page.

I've found that sometimes when I edit routes.rb and add a route, particularly if it's a resource, thinks get wonky and I get this error. Restarting script/server ended up fixing my problem when google yielded nothing for me.

This blog is now called "Ryan Owens is a Nerd (roian)"!

Greetings! It's been a while. I'm going to change things up a bit here. The original format of this blog was more of a personal journal, but it seems more useful (and easier) to just post tidbits as I am inspired to do so. So I'm going to do that now. And I'm renaming it since I couldn't get the associated url on blogger/blogspot.

So my advice is, even if you're hosting externally, go ahead and get the blogger url for your blog when you start up a new one.