Diary of problems and solutions related to web programming, database development and related technologies and platforms.

Duplicating project on Ruby on rails

Create a folder lets say "railsnewprj_temp" though the project folder name is going to be "railsnewprj"
Lets say the old rails project's name is ":railsproject". In config/database.yml file, replace the following
database: railsproject_development
database: railsproject_test
database: railsproject_production
username: railsproject
password: <%= ENV['RAILSPROJECT_DATABASE_PASSWORD'] %>
by
database: railsnewprj_development
database: railsnewprj_test
database: railsnewprj_production
username: railsnewprj
password: <%= ENV['RAILSNEWPRJ_DATABASE_PASSWORD'] %>
Create a new rails project
C:\row\dev>rails new railsnewprj -d mysql
Go to railsnewprj
C:\row\dev>cd railsnewprj
Create database
C:\row\dev\railsnewprj>rake db:create
This will create database in mysql
Copy the files and folders inside railsnewprj_temp to railsnewprj
Migrate ie run the migration files (that has been copied to the railsnewprj folder)
C:\row\dev\railsnewprj>rake db:migrate
Copy the record related to administrators' username and password so that s/he can login to the system.

Installing any of the dependencies. Let's say ImageMagick installer (See this for more details) for managing Image uploads and so on.

End

No comments :

Post a Comment