Topic: How can i run a test an existing RoR website locally

Hi folks,

I am new in RoR and I  want to make some changes on an existing website that i admin.
The web site is in production using  :
Ruby on Rails 2.3.x With MySQL,
Apache + Passenger

What i want is to copy the whole website + the connection string and test it locally on my machine in order to be able to do mods with zero risk.


So far i have installed the following on my machine (UBUNTO 10) :

ruby 1.9.2p136 (2010-12-25 revision 30365) [i686-linux]
MySQL
Server version: Apache/2.2.16 (Ubuntu)
Phusion Passenger version 3.0.2


Is there a best way to copy the website and paste it locally into my machine and how can i identify the connection  strings and change them to pin point the local dbs  & tables ?

Or is there any other alternate option ?

thank you

Re: How can i run a test an existing RoR website locally

Database config is in config/database.yml but if you don't know that already you probably aren't best placed to be making any other changes.

1. Clone/checkout/copy the rails application to your local machine
2. Download a dump of the database and import it to your local DB
3. Update config/database.yml to point to your local machine
4. Install dependencies/gems/etc...
5. Start up the app and do your work.

Re: How can i run a test an existing RoR website locally

hey thanks for the clear steps.

will i expect any version conflict if i am using rails 3.0 and ruby 1.9.2 as the production one is using Ruby on Rails 2.3.x

thanks

Re: How can i run a test an existing RoR website locally

You should expect many conflicts. Get yourself a copy of Rails 2.3.x installed.

Re: How can i run a test an existing RoR website locally

Hi Adam,

i have been able to import the database. but still having difficulties to run the website.
how can i know what rails version and ruby version the website is running ?

in order to replicate the environment

thanks