可以“复制和粘贴"整个 Rails 应用程序吗? [英] Possible to 'copy and paste' a whole Rails application?
问题描述
在我的 Rails 应用程序文件夹rails-apps"中,我在本地计算机上运行了一个功能齐全的 Rails 应用程序,名为first-app".我想在 rails-apps(称为second-app")中创建第二个应用程序,它与 first-app 相同,只是名称不同.
I have a fully-functioning Rails application running on my local machine called 'first-app' in my Rails applications folder 'rails-apps'. I would like to create a second application in rails-apps (called 'second-app') which is identical to first-app, just with a different name.
我可以简单地复制并粘贴第一个应用程序并将文件夹重命名为第二个应用程序"吗?我发现整个应用程序中只有两个文件包含术语first-app"(application.rb 和 routes.rb,都在配置中),所以大概我也必须更改它们的内容.如果这种复制和粘贴"方法可行,我还需要更改其他文件吗?
Can I simply copy-and-paste first-app and rename the folder to 'second-app'? I have found only two files in the whole application which contain the term 'first-app' (application.rb and routes.rb, both in config), so presumably I would have to change their contents as well. If this 'copy-and-paste' approach is viable, are there any other files I would have to alter?
如果我必须做通常的 > rails new second-app,我必须能够从 first-app 复制和粘贴很多文件和文件夹.哪些是我必须手动更改或使用 rails 命令构建的?
If I have to do the usual > rails new second-app, I must be able to copy and paste a lot of the files and folders from first-app. Which are the ones that I have to manually alter or construct with a rails command?
推荐答案
是的,它应该有效!只需在复制项目中将旧条款('first-app')替换为'second-app'并为新应用创建一个新数据库.
yes, it should works! Just replace in the copy-project the old terms('first-app') to 'second-app' and create a new database for the new app.
这篇关于可以“复制和粘贴"整个 Rails 应用程序吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!