Can I copy and paste an entire Rails application?

I have a fully functional Rails application running on my local computer called "first application" in my "Rails Applications" folder in Rails. I would like to create a second application in rails-apps (called the "second application"), which is identical to the first application, just with a different name.

Is it possible to simply copy and paste the first application and rename the folder to the "second application"? I found only two files in the entire application that contain the term "first application" (application.rb and routes.rb, both in the configuration), so I probably have to change their contents too. If this “copy and paste” approach is viable, are there any other files that I would have to modify?

If I need to make a regular> new new rails application, I should be able to copy and paste many files and folders from the first application. Which ones do I need to manually modify or build with the rails command?

+8
ruby-on-rails
source share
3 answers

yes it should work! Simply replace the old terms (“first application”) with “second application” in the copy project and create a new database for the new application.

+3
source share

You can copy and skip the first application folder and use gem 'rename' to rename the copied application. Follow these instructions: How to rename a rails 4 application?

+1
source share

Just copy the application to a new folder:

 $ cp your-old-app your-new-app 

If you want to create a new database for the new application, rename the development config/database.yml in config/database.yml .

After that, all you have to do is rake db:create db:migrate

0
source share

Source: https://habr.com/ru/post/651071/


All Articles