Rake goes crazy on me!

OK, so I used ./scripts/generate to generate a model, and then I entered the db/migrate/ and edit 001xxxx.rb so I can populated the database. After I entered some ruby code to have the file 001xxx.rb to generate some columns for table in db later, then I do rake1.9 db:migrate to generate table and columns.

Instead of getting the task to be carried out, rake complained:

rake1.9 db:migrate (in /home/powerone/My_Rails_01/myapplication) Missing the Rails 2.3.2 gem. Please `gem install -v=2.3.2 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.

I went into config/environment.rb and saw that RAILS_GEM_VERSION is indeed has 2.3.2 as parameter.

I do rails -v and got Rails 2.3.2 at the prompt

Then I went to do sudo gem1.8 update --system and got response as nothing to be update.

I went back and do rake1.9 db:migrate, and I got the same error.

I even do rake1.9 -T and got the same error.

I did rake1.9 --help and it works by showing help commands.

Then I did rake1.9 -V and got back as "rake, version 0.8.0"

How do I get my rake right so I can do rake db:migrate and other rake's tasks?

It seems that rake1.9 is misleading because when I did rake1.9 -V and I got back as rake version 0.8.0. Is this the real problem? And how do I fix it? Thanks...

By the way when I googled for this, I got no answer. Maybe I'm just not good with googling for ruby :(. I'm pretty sure I got what I want from a genius "Google" for other stuffs though, but not this time around!

Any help will make my day! :slight_smile: Thanks...

Going to sleep for now, peace out! hehehe

Power One wrote:

You're using two different versions of things. Try rake1.8 db:migrate or gem1.9 list

Or perhaps compare:    gem1.8 env    gem1.9 env Particularly the RUBY VERSION and the GEM PATHS and I think you'll see the problem.


Rob Biedenharn http://agileconsultingllc.com Rob@AgileConsultingLLC.com