How to include a ruby gem environment.rb file?

I’m doing a Web Service Based on a page I found
( using
the rails version 2.3.4, the web service is already working, but when
working on a version Previous:

RAILS_GEM_VERSION = '2 .0.2 'unless defined? RAILS_GEM_VERSION

I can not run the service.

On the previous page, there’s a part that says:

  1. Next step is to add the gem to the conf / environment.rb so that is
    knows the correct gem actionwebservice

    config.gem ‘dougbarth-actionwebservice’,: lib => ‘actionwebservice’

But if I do it, I can not run the service, the program sends this

C:/Users/usuario/Desktop/Servidor/test/config/environment.rb:26: private
method `gem’ called for #Rails::Configuration:0x5c5dbcc

On this page:,
is as follows:

OLD open_id_authentication plugin init.rb require ‘Yadis’ require

‘openid’ ActionController:: Base.send: include OpenIdAuthentication

NEW config.gem “ruby-openid”,: lib => “openid”,: version => “1.1.4”

config.gem “ruby-Yadis”,: lib => “Yadis”,: version => " 0.3.4 "

But I do not like change, please, I need help.

Thanks and regards.

Hi Jorge,

It’s because config.gem was first introduced in version 2.1 – that’s why
doesn’t work in 2.0.2. You can see that in by
looking under “Added config.gem for specifying which gems are required
the application” and then moving up until you see the version.


2010/3/24 Jorge alejandro Mendoza torres [email protected]

Hi Lasse.

I had an application in version 2.0.2 and I changed the version of the
application already had, I thought it would be harder, but it was very

On the page you mention, as I checked it, and is very helpful.

Thanks for responding.


Nice – good you got it working :slight_smile:


2010/3/26 Jorge alejandro Mendoza torres [email protected]