# Script/server reference wrong version of initializer.rb

**URL:** <https://www.ruby-forum.com/t/script-server-reference-wrong-version-of-initializer-rb/183791>\
**Category:** Rails\
**Created:** [February 20, 2010, 4:22am UTC](https://www.ruby-forum.com/t/script-server-reference-wrong-version-of-initializer-rb/183791 "2010-02-20T04:22:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![RichardOnRails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e0b2c6/32.png) [@RichardOnRails](https://www.ruby-forum.com/u/RichardOnRails)\
**Post date:** [February 20, 2010, 4:22am UTC](https://www.ruby-forum.com/t/script-server-reference-wrong-version-of-initializer-rb/183791/1 "2010-02-20T04:22:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![RichardOnRails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e0b2c6/32.png) [@RichardOnRails](https://www.ruby-forum.com/u/RichardOnRails)\
**Post date:** [February 20, 2010, 9:25am UTC](https://www.ruby-forum.com/t/script-server-reference-wrong-version-of-initializer-rb/183791/2 "2010-02-20T09:25:46Z")

</div>

On 20 February 2010 03:21, RichardOnRails  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> 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.

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

---

<div class="post-metadata">

**Author:** ![RichardOnRails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e0b2c6/32.png) [@RichardOnRails](https://www.ruby-forum.com/u/RichardOnRails)\
**Post date:** [February 20, 2010, 3:53pm UTC](https://www.ruby-forum.com/t/script-server-reference-wrong-version-of-initializer-rb/183791/3 "2010-02-20T15:53:47Z")

</div>

On 20 February 2010 14:32, RichardOnRails  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> 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

---

<div class="post-metadata">

**Author:** ![RichardOnRails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e0b2c6/32.png) [@RichardOnRails](https://www.ruby-forum.com/u/RichardOnRails)\
**Post date:** [February 20, 2010, 5:10pm UTC](https://www.ruby-forum.com/t/script-server-reference-wrong-version-of-initializer-rb/183791/4 "2010-02-20T17:10:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![RichardOnRails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e0b2c6/32.png) [@RichardOnRails](https://www.ruby-forum.com/u/RichardOnRails)\
**Post date:** [February 20, 2010, 3:34pm UTC](https://www.ruby-forum.com/t/script-server-reference-wrong-version-of-initializer-rb/183791/5 "2010-02-20T15:34:28Z")

</div>

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
