Rails: database connection

I have been using rails to talk to MySQL. I followed the below tutorial and I have been getting erros on using rake db:migrate. Could some let me know how to resolve it.

Tutorial:

Error: srilatha-bhuvanapallis-macbook-pro:contacts Latha$ rake db:migrate (in /Users/Latha/LearningRuby/contacts) == CreateContacts: migrating

I have been using rails to talk to MySQL. I followed the below
tutorial and I have been getting erros on using rake db:migrate. Could some let me know how to resolve it.

Sounds like you're using a version of rails older than 2.0

Fred

Frederick Cheung wrote:

Frederick Cheung wrote:

I have been using rails to talk to MySQL. I followed the below tutorial and I have been getting erros on using rake db:migrate. Could some
let me know how to resolve it.

Sounds like you're using a version of rails older than 2.0

Fred

My version of rails is 2.1.2 srilatha-bhuvanapallis-macbook-pro:contacts Latha$ rails -v Rails 2.1.2

but is that app set to use an old version of rails (eg because it's
frozen into vendor/rails or because RAILS_GEM_VERSION is set ) ? And of course seeing the actual code producing an error always helps.

Frederick Cheung wrote:

Frederick Cheung wrote:

Sounds like you're using a version of rails older than 2.0

Fred

My version of rails is 2.1.2 srilatha-bhuvanapallis-macbook-pro:contacts Latha$ rails -v Rails 2.1.2

but is that app set to use an old version of rails (eg because it's frozen into vendor/rails or because RAILS_GEM_VERSION is set ) ? And of course seeing the actual code producing an error always helps.

Could I please how to check if my app to set to old version of rails?

The easiest way is to run script/console or script/server - they will
tell you what version of rails is being used.

Frederick Cheung wrote:

srilatha-bhuvanapallis-macbook-pro:contacts Latha$ rails -v Rails 2.1.2

but is that app set to use an old version of rails (eg because it's frozen into vendor/rails or because RAILS_GEM_VERSION is set ) ? And of course seeing the actual code producing an error always helps.

Could I please how to check if my app to set to old version of rails?

The easiest way is to run script/console or script/server - they will tell you what version of rails is being used.

Below is what I get when I run script/server:

srilatha-bhuvanapallis-macbook-pro:MyProject Latha$ ruby ./script/server ./script/../config/boot.rb:20:Warning: Gem::SourceIndex#search support for String patterns is deprecated => Booting Mongrel (use 'script/server webrick' to force WEBrick) => Rails application starting on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server ** Starting Mongrel listening at 0.0.0.0:3000 ** Starting Rails with development environment... ** Rails loaded. ** Loading any Rails specific GemPlugins ** Signals ready. TERM => stop. USR2 => restart. INT => stop (no restart). ** Rails signals registered. HUP => reload (without restart). It might not work well. ** Mongrel 1.1.5 available at 0.0.0.0:3000 ** Use CTRL-C to stop.

Where does it show me the rails version here, Sorry to bother you too much. I am new to rails. Kindly bear with me.

Thanks Latha

Frederick Cheung wrote:

srilatha-bhuvanapallis-macbook-pro:contacts Latha$ rails -v Rails 2.1.2

but is that app set to use an old version of rails (eg because it's frozen into vendor/rails or because RAILS_GEM_VERSION is set ) ? And of course seeing the actual code producing an error always
helps.

Could I please how to check if my app to set to old version of
rails?

The easiest way is to run script/console or script/server - they will tell you what version of rails is being used.

Below is what I get when I run script/server:

It doesn't - newer versions would tell you which already tells you
that you're probably not running 2.1.2. ruby script/console might still tell you (I can't remember when they
started showing versions)

And like I said before check if your environment.rb sets
RAILS_GEM_VERSION or if vendor/rails is present.

Fred

Frederick Cheung wrote: