Welcome to Arkanis Development

locator.rb:91:in `add': wrong number of arguments

Published

This post is about a Ruby on Rails problem that troubled me some time now. More specifically it's about Rails' gem dependencies which somehow do not work on Ubuntu 8.04. No matter which gem I added to the gem list in environment.rb, Rails raised a strange error as soon as the gem was installed:

/usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/rails/plugin/locator.rb:91:in `add': wrong number of arguments (2 for 1) (ArgumentError)
  from /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/rails/plugin/locator.rb:91:in `plugins'
  from /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/rails/plugin/loader.rb:63:in `locate_plugins'
…

After searching around a bit I found the Rails ticket #293 at Lighthouse. The last post describes the error above and luckily explains the solution.

The Rubygem files are usually stored at /usr/local/lib/site_ruby/1.8. These are the up to date source files for Rubygems. I installed this Rubygems version from source but somehow an older version of Rubygems found it's way into the /usr/lib/ruby/1.8 directory. Now Rails used the obsolete Rubygems stuff from there which caused the error.

The solution

After deleting the /usr/lib/ruby/1.8/rubygems directory and the /usr/lib/ruby/1.8/rubygems.rb file everything went fine. Rails gem dependencies up and working. :)

If someone knows which deb packet contains these obsolete Rubygem files, please let me know or file a bug report at Luncepad.

Thanks to Dusty Doris for hunting down this bug and pointing out the solution. I hope this post will make the search a bit easier for people with the same problem.

2 comments for this post

leave a new one

#1 by
Jorge Alvarez
,

Thank you very much for your post. Indeed it is a strage and nasty error i was googling for about an hour before your website comes to my rescue. Thanks again!!

#2 by
keyJ
,

Hi Stephan. Thanks for this article. It really helped me out. I guess you don't mind me, writing about the error on my blog and mentioning you. ;) Greetings. keyJ

Leave a new comment

Having thoughts on your mind about this stuff here? Want to tell me and the rest of the world your opinion? Write and post it right here. Be sure to check out the format help (focus the large text field) and give the preview button a try.

Format help

Please us the following stuff to spice up your comment.

An empty line starts a new paragraph. ---- print "---- lines start/end code" ---- * List items start with a * or -

or