Script/server reference wrong version of initializer.rb

Hi All,

In my Rails app RTS, I specify: RAILS_GEM_VERSION = '2.3.5' in \RTS\config\environment.rb

I have no Windows environment variable named RAILS_GEM_VERSION

When I run ruby script/server, I get the error message:

K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/ lib/initializer.rb:328:in `send': undefined method `session=' for ActionController::Base:Class (NoMethodError)

Why did the server script reference a rails-1.2.3 gem, rather than a 2.3.5 gem? The 1.2.3 version of initializer.rb uses metaprogramming which likely produced the variable name "session=" which might have been correct in the 1.2.3 context. But the 2.3.5 version of initializer.rb should have been invoked and it looks fine on this score.

So, what's up?

TIA, Richard

Have you frozen the earlier version of Rails into your app? Look in your apps vendor folder for a folder rails. If it is there remove it.

Colin

Thanks for responding to my plight.

Have you frozen the earlier version of Rails into your app? Look in your apps vendor folder for a folder rails. If it is there remove it.

My app is RTS. The RTS\vendor folder has no files and one empty folder: plugins. Furthermore, I've never been sophisticated in Rails to use "freeze".

However, I'm new to the 2.0 version and tried to solve problems I had by downloading/executing the Chapter 1 sample from Rippen's "Pro RoR". It referenced ver. 1.2.3, so I downloaded/installed 1.2.3 yesterday. That led to other problems so I abandoned Rippen's example.

Is it more than coincidence that the problematic version of initializer was 1.2.3??

Again, thanks for looking into my problem, Richard

Thanks for responding to my plight.

Have you frozen the earlier version of Rails into your app? Look in your apps vendor folder for a folder rails. If it is there remove it.

My app is RTS. The RTS\vendor folder has no files and one empty folder: plugins. Furthermore, I've never been sophisticated in Rails to use "freeze".

However, I'm new to the 2.0 version and tried to solve problems I had by downloading/executing the Chapter 1 sample from Rippen's "Pro RoR". It referenced ver. 1.2.3, so I downloaded/installed 1.2.3 yesterday. That led to other problems so I abandoned Rippen's example.

Is it more than coincidence that the problematic version of initializer was 1.2.3??

I am sure it is more than a coincidence. If you do gem list it will show you which versions you have installed. Assuming you no longer need any except the latest versions you can do gem cleanup which will remove all versions except the latest. At the very least that should change the symptom you are having.

Colin

You were right, i.e. it was more than a coincidence. I took a more conservative approach when using your advice: I deleted that 1.2.3 thing directly from Windows Explorer. It took some doing because something was still referencing it although I had no Ruby or Rails stuff running. I think THAT was the real cause of my misadventure.

Bottom line: Mongrel came up and localhost:3000 brought up my app.

Thank you very much for offering your guidance.

Best wishes, Richard