Require gems messing up rails install?

I have a strange issue. My rails environment is fully functional with
enterprise ruby, rails 2.3.5, running on passenger in production. In
my .irbrc I am trying to include wirble gem for auto completion and
coloring so I add the following lines and install wirble. As soon as I
do that, it messes up my rails install and throws an error saying
“rails gem is not installed”, though it’s. If I uninstall wirble and
leave these lines in .irbrc the problem goes away. I am guesing it has
something to do with the ‘require rubygems’, but this is not a problem
in my development environment. I have the same .irbrc, the only
difference is my dev environment runs regular ruby 1.8.7 not
enterprise ruby

require ‘irb/completion’
IRB.conf[:PROMPT_MODE] = :SIMPLE
require ‘rubygems’
#require ‘RMagick’
require ‘wirble’

if ENV[‘RAILS_ENV’]
require ‘rubygems’
require ‘hirb’
require ‘active_record’
Hirb.enable
ActiveRecord::Base.logger = Logger.new(STDOUT)
end

Any ideas?

Thanks

Here is the exact error.

Missing the Rails 2.3.5 gem. Please gem install -v=2.3.5 rails,
update your RAILS_GEM_VERSION setting in config/environment.rb for the
Rails version you do have installed, or comment out RAILS_GEM_VERSION
to use the latest version installed

Rails is installed!

xxx@server:/var/www/myapp/current$ rails --version
Rails 2.3.5

Anyone?