installed rails 2.3.9 but keep getting rails 2.3.2

hi guys

I have a working rails application. I have rails 2.3.9 installed in
my existing dev & prod machines.

When I run script/server, i keep getting an indication that rails
2.3.2 is being used.
The message reads, "Loading development environment (Rails 2.3.2)".

I don't have rails 2.3.2 installed and yet this occurs.
Furthermore, there is no reference to rails 2.3.2 in even my config/
environment.rb file.

Is there something wrong when I use "script/server"?
what could be wrong?

thanks

Gordon

just to add, the machines that I have used that exhibit this behaviour
are ubuntu 9 and 10.04.

Thank you

What does
gem list
show?

Colin

Hi,

Are you using bundler ? If so please do check bundle show rails on your root and check which version is being used.

@Colin - running "gem list --local", I observed rails is only 2.3.9
(ie. "rails (2.3.9)")

@Dhruva - no, I am not running bundler

Please don't top post, it is easier to follow the thread if you insert
your post into the previous reply. Thanks

Can you show the complete output of gem list (run from the rails
application root) please, also the complete output of script/server.
Also
rails -v
ruby -v

Colin

Sorry, also post your environment.rb

Thanks

Colin

root@ct9a-dev:~/projects/myApp# rails -v

Rails 2.3.9

root@ct9a-dev:~/projects/myApp# ruby -v

ruby 1.9.1p378 (2010-01-10 revision 26273) [i686-linux]

roo@ct9a-dev# script/server

=> Booting WEBrick

=> Rails 2.3.2 application starting on http://0.0.0.0:3000

environment.rb:

> @Colin - running "gem list --local", I observed rails is only 2.3.9
> (ie. "rails (2.3.9)")

Please don't top post, it is easier to follow the thread if you insert
your post into the previous reply. Thanks

Can you show the complete output of gem list

You have not provided the gem list output

(run from the rails
application root) please, also the complete output of script/server.
Also
rails -v
ruby -v

root@ct9a-dev:~/projects/myApp# rails -v
Rails 2.3.9
root@ct9a-dev:~/projects/myApp# ruby -v
ruby 1.9.1p378 (2010-01-10 revision 26273) [i686-linux]
roo@ct9a-dev# script/server
=> Booting WEBrick
=> Rails 2.3.2 application starting on http://0.0.0.0:3000

Does it just stop there, or is there more? Also is there anything in
development.log?
Does the app go on to function?

@Colin - running “gem list --local”, I observed rails is only 2.3.9

(ie. “rails (2.3.9)”)

Please don’t top post, it is easier to follow the thread if you insert

your post into the previous reply. Thanks

Can you show the complete output of gem list

You have not provided the gem list output

Here:

------- Start -----

*** LOCAL GEMS ***

actionmailer (2.3.9)

actionpack (2.3.9)

activemodel (3.0.3)

activerecord (3.0.3, 2.3.9)

activeresource (2.3.9)

activesupport (3.0.3, 2.3.9)

arel (2.0.6)

authlogic (2.1.6)

breadcrumbs_on_rails (1.0.1)

builder (2.1.2)

i18n (0.5.0)

paperclip (2.3.8)

prawn (0.8.4)

prawn-core (0.8.4)

prawn-layout (0.8.4)

prawn-security (0.8.4)

rack (1.1.0)

rails (2.3.9)

rake (0.8.7)

riddle (1.2.2)

rubygems-update (1.3.7)

searchlogic (2.4.27)

thinking-sphinx (2.0.1)

tzinfo (0.3.23)

will_paginate (2.3.15)

------- End -----

(run from the rails

application root) please, also the complete output of script/server.

Also

rails -v

ruby -v

root@ct9a-dev:~/projects/myApp# rails -v

Rails 2.3.9

root@ct9a-dev:~/projects/myApp# ruby -v

ruby 1.9.1p378 (2010-01-10 revision 26273) [i686-linux]

roo@ct9a-dev# script/server

=> Booting WEBrick

=> Rails 2.3.2 application starting on http://0.0.0.0:3000

Does it just stop there, or is there more? Also is there anything in

development.log?

Does the app go on to function?

  1. yes, it just stops there and does not go any further.

Here’s what it looks like:

---------- start ------------------

ct9a@ct9a:~/projects/myApp$ script/console

Loading development environment (Rails 2.3.2)

/home/ct9a/projects/myApp/vendor/rails/railties/lib/rails/gem_dependency.rb:99:Warning: Gem::Dependency#version_requirements is deprecated and will be removed on or after August 2010. Use #requirement

/usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:223:in activate': undefined method map’ for nil:NilClass (NoMethodError)

from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:249:in `block in activate’

from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:248:in `each’

from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:248:in `activate’

from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:1082:in `gem’

from /home/ct9a/projects/myApp/vendor/rails/railties/lib/rails/gem_dependency.rb:57:in `add_load_paths’

from /home/ct9a/projects/myApp/vendor/rails/railties/lib/initializer.rb:299:in `block in add_gem_load_paths’

from /home/ct9a/projects/myApp/vendor/rails/railties/lib/initializer.rb:299:in `each’

from /home/ct9a/projects/myApp/vendor/rails/railties/lib/initializer.rb:299:in `add_gem_load_paths’

from /home/ct9a/projects/myApp/vendor/rails/railties/lib/initializer.rb:132:in `process’

from /home/ct9a/projects/myApp/vendor/rails/railties/lib/initializer.rb:113:in `run’

from /home/ct9a/projects/myApp/config/environment.rb:13:in `<top (required)>’

from /usr/local/lib/ruby/1.9.1/irb/init.rb:264:in `require’

from /usr/local/lib/ruby/1.9.1/irb/init.rb:264:in `block in load_modules’

from /usr/local/lib/ruby/1.9.1/irb/init.rb:262:in `each’

from /usr/local/lib/ruby/1.9.1/irb/init.rb:262:in `load_modules’

from /usr/local/lib/ruby/1.9.1/irb/init.rb:20:in `setup’

from /usr/local/lib/ruby/1.9.1/irb.rb:53:in `start’

from /usr/local/bin/irb:12:in `’

ct9a@ct9a:~/projects/myApp$

---------- end ------------------

  1. i could not find any “log” subdirectory. I even made one manually

and re-ran ‘script/console’. Still nothing :frowning:

  1. no, the app dies just there

>> > @Colin - running "gem list --local", I observed rails is only 2.3.9
>> > (ie. "rails (2.3.9)")
>>
>> Please don't top post, it is easier to follow the thread if you insert
>> your post into the previous reply. Thanks
>>
>> Can you show the complete output of gem list

You have not provided the gem list output

Here:

------- Start -----
*** LOCAL GEMS ***
actionmailer (2.3.9)
actionpack (2.3.9)
activemodel (3.0.3)
activerecord (3.0.3, 2.3.9)

So you have some rails gems from 2.3.9, some from 3.0.3 and some from
both, and in environment.rb you ask for 2.3.5. I don't know why that
would cause it to say it was loading 2.3.2 but it is certainly never
going to work as it is. I think you need to sort out the versions. I
would suggest installing rvm and starting again.

Colin

Colin Law wrote in post #970471:

You have not provided the gem list output

Here:

------- Start -----
*** LOCAL GEMS ***
actionmailer (2.3.9)
actionpack (2.3.9)
activemodel (3.0.3)
activerecord (3.0.3, 2.3.9)

So you have some rails gems from 2.3.9, some from 3.0.3 and some from
both, and in environment.rb you ask for 2.3.5. I don't know why that
would cause it to say it was loading 2.3.2

Probably because it's picking up 2.3.2 from vendor/rails.

but it is certainly never
going to work as it is.

Why do you say that?

I think you need to sort out the versions. I
would suggest installing rvm and starting again.

Agreed.

Colin

Best,

Colin Law wrote in post #970471:

You have not provided the gem list output

Here:

------- Start -----
*** LOCAL GEMS ***
actionmailer (2.3.9)
actionpack (2.3.9)
activemodel (3.0.3)
activerecord (3.0.3, 2.3.9)

So you have some rails gems from 2.3.9, some from 3.0.3 and some from
both, and in environment.rb you ask for 2.3.5. I don't know why that
would cause it to say it was loading 2.3.2

Probably because it's picking up 2.3.2 from vendor/rails.

Good point, I had not thought of that. I should have done.

but it is certainly never
going to work as it is.

Why do you say that?

I said it because I had not thought of a version frozen in vendor,
which I think is a perfectly good reason for saying it, even though as
a statement of truth it is fatally flawed :slight_smile:

Colin

I did notice that it’s picking up 2.3.2 from vendor/rails.

I removed vendor/rails and when I ran “script/console”, it does not look for 2.3.2 anymore. Instead, it was 2.3.8 (as i specified “RAILS_GEM_VERSION = ‘2.3.8’ unless defined? RAILS_GEM_VERSION” in my config/environment.rb.

I then looked up all the gems in http://rubygems.org/gems/ and made sure the versions were the right ones as per my working development and production machines. Problem solved but i somehow think removing vendor/rails is not so right…

Gordon Yeong wrote in post #970555:
[...]

Problem solved but i somehow think removing
vendor/rails is not so right....

Where did you get that idea? Removing vendor/rails is exactly right in
this case -- it's only purpose is to override the system Rails gems. If
you want to freeze 2.3.8 into vendor/rails, you can do so.

Note, however, that 2.3.9, and I think 2.3.8, have serious security
holes. I'd recommend upgrading to 2.3.10 as soon as possible.

Best,

Also don't forget that when you change the version you should run
rake rails:update
to update rails scripts etc.

Colin

Gordon Yeong wrote in post #970555:

[…]

Problem solved but i somehow think removing

vendor/rails is not so right…

Where did you get that idea? Removing vendor/rails is exactly right in

this case – it’s only purpose is to override the system Rails gems. If

you want to freeze 2.3.8 into vendor/rails, you can do so.

Marnen, you were right on the money!

“Probably because it’s picking up 2.3.2 from vendor/rails.”.

thank you for that :slight_smile:

Note, however, that 2.3.9, and I think 2.3.8, have serious security

holes. I’d recommend upgrading to 2.3.10 as soon as possible.

Yep, I m testing the application and making sure it works on 2.3.8. Once it is stable, I shall look at 2.3.10

hello, Colin,

I shall do so. Thank you and Merry x’mas!

Gordon :slight_smile:

Hello,

yes, doesn't have anything with Ubuntu, but your gems are confused.
Installing RVM really solves all your problems, and also prevents
later: http://rvm.beginrescueend.com/

Ruby 1.8.7 + Gem 1,3,5 + Rails 2.3.8
and
Ruby1.9 +Gem1.3.7+Rails3
works together fine.

When installing gems using RVM always pay attention not to use 'sudo'
before commands, so the gems will be Ruby version dependent. So not
"sudo gem install rails" instead only "gem install rails" after
installing RVM and setting default Ruby.

Good luck,
gezope