简体   繁体   English

更改Rails应用程序名称的最简单,最快的方法?

[英]Easiest and fastest way of changing the name of your Rails app?

At first I thought it was as easy as changing the name of your app's folder. 起初,我认为这就像更改应用程序文件夹的名称一样容易。 But then I realized things like this: 但是后来我意识到了这样的事情:

application.rb: application.rb:

module NameOfMyApp
  class Application < Rails::Application
    # Settings in config/environments/* take precedence over those specified here.
(etc...)

So now I'm afraid that something will brake if I start changing the name of my app in the files. 所以现在我担心,如果我开始在文件中更改应用程序的名称,某些操作会刹车。

What's the easiest and fastest way of changing the name of your Rails app? 更改Rails应用程序名称的最简单,最快的方法是什么?

Well I would do it manually, not sure how else you could achieve it. 好吧,我会手动完成它,不确定是否还能实现它。 Here is a list of all of the files you would need to change the name in: 这是您需要在其中更改名称的所有文件的列表:

  • config/application.rb (line 12) config / application.rb(第12行)
  • config/environment.rb (line 5) config / environment.rb(第5行)
  • config/environments/development.rb (line 1) config / environments / development.rb(第1行)
  • config/environments/production.rb (line 1) config / environments / production.rb(第1行)
  • config/environments/test.rb (line 1) config / environments / test.rb(第1行)
  • config/initializers/secret_token.rb (line 7) config / initializers / secret_token.rb(第7行)
  • config/initializers/session_store.rb (line 3 and 8) config / initializers / session_store.rb(第3行和第8行)
  • config/routes.rb (line 1) config / routes.rb(第1行)
  • config.ru config.ru
  • Rakefile 瑞克文件

Note: The line counts above are on a newly generated application, they may be different if you have changed the contents of any of these files. 注意:上面的行数是在新生成的应用程序上,如果您更改了任何这些文件的内容,它们可能会有所不同。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM