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.