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

On 24 December 2010 08:23, ct9a [email protected] wrote:

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?

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.


Thanks & Regards,
Dhruva S. http://dhruvasagar.net.

On 24 December 2010 11:27, ct9a [email protected] wrote:

@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 (run from the rails
application root) please, also the complete output of script/server.
Also
rails -v
ruby -v

Colin

On 24 December 2010 11:34, Colin L. [email protected] wrote:

rails -v
ruby -v

Sorry, also post your environment.rb

Thanks

Colin

@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

On 24 December 2010 22:34, Colin L. [email protected] wrote:

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

environment.rb:

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

Specifies gem version of Rails to use when vendor/rails is not present

RAILS_GEM_VERSION = ‘2.3.5’ unless defined? RAILS_GEM_VERSION

require File.join(File.dirname(FILE), ‘boot’)

Rails::Initializer.run do |config|
config.gem “breadcrumbs_on_rails”

config.gem(
‘thinking-sphinx’,
:lib => ‘thinking_sphinx’
)

config.gem ‘authlogic’

config.gem ‘riddle’
config.gem ‘thoughtbot-paperclip’, :lib => ‘paperclip’, :source => ’
http://gems.github.com

config.gem ‘searchlogic’

config.gem ‘will_paginate’, :version => ‘~> 2.3.11’, :source => ’
http://gemcutter.org

config.gem ‘prawn’, :version => ‘0.8.4’

this is used by rawk - a log profiling tool

class Logger
def format_message(severity, timestamp, progname, msg)
“#{msg} (pid:#{$$})\n”
end
end
config.time_zone = ‘UTC’

config.action_controller.session_store = :active_record_store

config.cache_store = :mem_cache_store

config.active_record.observers = :user_observer, :part_observer,
:notification_observer, :feedback_observer, :recommendation_observ
er

config.action_mailer.default_url_options = { :host => “www.myApp.com
}

config.gem ‘whenever’, :lib => false, :source =>
http://gemcutter.org/

set delivery method to :smtp, :sendmail or :test

config.action_mailer.delivery_method = :sendmail
config.action_mailer.raise_delivery_errors = true
config.action_mailer.perform_deliveries = true # try this.
end

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

** note: the environment.rb works well on both my production and old
development servers

On 24 December 2010 11:41, Gordon Y. [email protected] wrote:

your post into the previous reply. Thanks

Can you show the complete output of gem list

You have not provided the gem list output

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?

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

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:

  2. no, the app dies just there

On 24 December 2010 12:16, Gordon Y. [email protected] wrote:

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

On 24 December 2010 14:31, Marnen Laibow-Koser [email protected]
wrote:

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

On 25 December 2010 01:39, Colin L. [email protected] wrote:

*** LOCAL GEMS ***

a statement of truth it is fatally flawed :slight_smile:

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 Gems | RubyGems.org | your community gem host 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 Y. 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,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Sent from my iPhone

On 25 December 2010 06:27, Marnen Laibow-Koser [email protected]
wrote:

holes. I’d recommend upgrading to 2.3.10 as soon as possible.
Also don’t forget that when you change the version you should run
rake rails:update
to update rails scripts etc.

Colin

Colin L. wrote in post #970471:

On 24 December 2010 12:16, Gordon Y. [email protected] wrote:

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,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Sent from my iPhone

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

On 25 December 2010 17:27, Marnen Laibow-Koser [email protected]
wrote:

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