Difficulty adding RubyGem to environment.config

Hello-

I’m trying to use Subdomain Fu as a RubyGem (as opposed to a plugin).
I’m adding this line of text to my environment.rb:

config.gem ‘mbleigh-subdomain-fu’, :source => “http://
gems.github.com”, :lib => “subdomain-fu”

When I do, if I run script/about (or script/generate) I get the
following error:

/usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/rails/plugin/locator.rb:
91:in add': wrong number of arguments (3 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' from /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/rails/plugin/ loader.rb:62:in map’
from /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/rails/plugin/
loader.rb:62:in locate_plugins' from /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/rails/plugin/ loader.rb:27:in all_plugins’
from /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/rails/plugin/
loader.rb:22:in plugins' from /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/rails/plugin/ loader.rb:45:in add_plugin_load_paths’
from /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:
235:in add_plugin_load_paths' ... 6 levels... from /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/commands/about.rb:1 from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in gem_original_require’
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require’
from script/about:3

If I remove the config.gem line then running script/about produces the
following output:

About your application’s environment
Ruby version 1.8.6 (i486-linux)
RubyGems version 1.2.0
Rails version 2.1.0
Active Record version 2.1.0
Action Pack version 2.1.0
Active Resource version 2.1.0
Action Mailer version 2.1.0
Active Support version 2.1.0
Application root /home/emarthinsen/Desktop/Rails/
subdomain_test
Environment development
Database adapter sqlite3
Database schema version 0

Does anyone know what’s going on?

Regards-
Eric

On Aug 25, 10:14 pm, emarthinsen [email protected]
wrote:

[snip]

Hi Eric,

Adding the spec to environment.rb tells Rails that you’re using the
gem, but you still need to install it onto your machine:

rake gems:install

You also need to install it on all of your servers where the app will
run; or, “unpack” the gems you’re using into vendor/ so you won’t need
to:

rake gems:unpack

Jeff

REST with Rails: Do cool things with Rails! For beginning Rails
developers or those just new to REST.
Oct 4, 2008, Austin, TX
http://www.purpleworkshops.com/workshops/rest-and-web-services

Hi Jeff-

When I run “rake gems:install” I get exactly the same error about
having the wrong number of arguments in ‘add’. I’m wondering if there
is a versioning error going on here. The version numbers above, from
the successful run of script/about all look good though.

-Eric

I figured it out. I had multiple version of rubygems installed. I must
have had 3 versions installed at one time or another. I removed my
original install of rubygems using Synaptic (I’m on Ubuntu). I then
installed the latest rubygems from source. What I didn’t know was that
there was a third version lurking in my ruby installation folder. I
deleted that directory and this started working.

On Aug 25, 10:43 pm, emarthinsen [email protected]
wrote:

Hi Jeff-

When I run “rake gems:install” I get exactly the same error about
having the wrong number of arguments in ‘add’. I’m wondering if there
is a versioning error going on here. The version numbers above, from
the successful run of script/about all look good though.

-Eric

Ah, sorry I missed that in your original post. I’m not sure what’s
going on.

If you don’t get an answer here soon, perhaps try posting a comment on
his blog post?
http://www.mbleigh.com/2008/6/23/subdomainfu-a-new-way-to-tame-the-subdomain

If I figure it out I’ll post here again.

Jeff

REST with Rails: Do cool things with Rails! For beginning Rails
developers or those just new to REST.
Oct 4, 2008, Austin, TX, $295 (get 10% off, discount code “PWRRGG”)
http://www.purpleworkshops.com/workshops/rest-and-web-services