views:

66

answers:

3

I'm a newbie to Ruby on Rails. My problem is, I am trying to upgrade the rails version from 1.2.3 to 2.3.4.

I changed the .rhtml files to .html.erb according to the rails version 2.3.4. I changed the environment and boot.rb settings according to the rails version, but when I try to run the application, I'am getting missing template error it is searching for the view with .rhtml extension but not for the html.erb. Please kindly help me with this.

Thank you

A: 

You can make sure whether you have upgraded properly or not by going to script/console and whether it prints out

Loading development environment (Rails 2.3.4)

or not as you enter the console, that might give you some hints.

nas
Thanks for your response nas! I have upgraded the rails version , but when i run the rails -v command it shows 1.2.3. Is there anything to change?. Could u please help with the steps to be followed to upgrade the rails version from 1.2.3 to 2.3.4?
sam
Looks like its not installed properly or at all if rails -v shows 1.2.3. In that case, can you just run again 'sudo gem install rails' from the command line. And before doing that do "gem list rails" and see the versions installed.
nas
I un-installed everything and again I re-installed the rails application. Now it went through nicely.But now having a problem with cache_template_extensions error even after i removed from config/environments/development.rb.
sam
Can you do a grep/search for cache_template_extensions in your config directory or the whole app and just delete it if you find it anywhere
nas
Hey nas. I have also come up with the master search of my application for cache_template_extensions error,but nothing was found. Just ,I was blank with this. Is there any other reason for this error to occur?
sam
I cannot think of any but can you run a gem list command on your system and paste the output here?
nas
+1  A: 

Did you change your RAILS_GEM_VERSION in the config/environment.rb file? It may still be looking for the 1.2.3 gem, as opposed to the 2.3.4 gem.

Josh
Thank you for your quick response josh. But i have changed the rails version to 2.3.4 in environment.rb file and also i have freeze the gems in the current application with 2.3.4 version.One thing which i cant understand is .... when i run the rails -v command in console it shows the rails version as 1.2.3. . Could you please help me with this? Is there any other file where we should change the rails version. But i have upgraded the rails version.Thanks in-advancesam
sam
If you run the following command, `which gem`, you can see where the gem binary file. If 1.2.3 is using on executable, and you've installed the 2.3.4 gem with another executable (and its not in your path), you might run into problems. Install the 2.3.4 gem with the same executable as with 1.2.3.
Josh
A: 

Check if you have a copy of rails in the vendor directory. Also, what does script/about show?

Roger Ertesvag
hello Mr.Ertesvag. I have checked that whether i have a copy of rails in the vendor directory.I dont have one. when i run the ruby script/about command i am getting error as rails requires ruby gems >=1.3.2. So i run gem update --system command.when i run this command it shows nothing to update.but when i run the ruby script/about command am getting the same error.
sam