Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.
fixed version number and added information on how to do it with older rails version
Source Link
Daniel
  • 4.2k
  • 3
  • 29
  • 46

Since rails 4.14.1.x, if you want to rename your application, the only two files you need to modify are config/application.rb:

require File.expand_path('../boot', __FILE__) require 'rails/all' # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. Bundler.require(*Rails.groups) module YourApplicationName # <-- rename it here class Application < Rails::Application ... end end 

and config/initializers/session_store.rb (optional):

# Be sure to restart your server when you modify this file. Rails.application.config.session_store :cookie_store, key: '_your_application_name_session' # <-- rename the key 

For Rails 4.0.x4.0.x you can use the renamerename gem and execute the following command:

rails g rename:app_to New-Name 

This will update the necessary files for you:

old/ (master) › rails g rename:app_to new Search and replace module in to... gsub config.ru gsub Gemfile gsub Gemfile.lock gsub Rakefile gsub README.md gsub config/application.rb gsub config/boot.rb gsub config/environment.rb gsub config/environments/development.rb gsub config/environments/production.rb gsub config/environments/test.rb gsub config/initializers/backtrace_silencers.rb gsub config/initializers/filter_parameter_logging.rb gsub config/initializers/inflections.rb gsub config/initializers/load_class_extensions.rb gsub config/initializers/mime_types.rb gsub config/initializers/secret_token.rb gsub config/initializers/session_store.rb gsub config/initializers/update.rb gsub config/initializers/wrap_parameters.rb gsub config/routes.rb gsub config/initializers/session_store.rb Renaming references... Renaming directory...Done! New application path is '/Users/username/code/new' 

Since rails 4.1, if you want to rename your application, the only two files you need to modify are config/application.rb:

require File.expand_path('../boot', __FILE__) require 'rails/all' # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. Bundler.require(*Rails.groups) module YourApplicationName # <-- rename it here class Application < Rails::Application ... end end 

and config/initializers/session_store.rb (optional):

# Be sure to restart your server when you modify this file. Rails.application.config.session_store :cookie_store, key: '_your_application_name_session' # <-- rename the key 

For Rails 4.0.x you can use the rename gem and execute the following command:

rails g rename:app_to New-Name 

Since rails 4.1.x, if you want to rename your application, the only two files you need to modify are config/application.rb:

require File.expand_path('../boot', __FILE__) require 'rails/all' # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. Bundler.require(*Rails.groups) module YourApplicationName # <-- rename it here class Application < Rails::Application ... end end 

and config/initializers/session_store.rb (optional):

# Be sure to restart your server when you modify this file. Rails.application.config.session_store :cookie_store, key: '_your_application_name_session' # <-- rename the key 

For Rails 4.0.x you can use the rename gem and execute the following command:

rails g rename:app_to New-Name 

This will update the necessary files for you:

old/ (master) › rails g rename:app_to new Search and replace module in to... gsub config.ru gsub Gemfile gsub Gemfile.lock gsub Rakefile gsub README.md gsub config/application.rb gsub config/boot.rb gsub config/environment.rb gsub config/environments/development.rb gsub config/environments/production.rb gsub config/environments/test.rb gsub config/initializers/backtrace_silencers.rb gsub config/initializers/filter_parameter_logging.rb gsub config/initializers/inflections.rb gsub config/initializers/load_class_extensions.rb gsub config/initializers/mime_types.rb gsub config/initializers/secret_token.rb gsub config/initializers/session_store.rb gsub config/initializers/update.rb gsub config/initializers/wrap_parameters.rb gsub config/routes.rb gsub config/initializers/session_store.rb Renaming references... Renaming directory...Done! New application path is '/Users/username/code/new' 
fixed version number and added information on how to do it with older rails version
Source Link
Daniel
  • 4.2k
  • 3
  • 29
  • 46

Update: This change was introduced in Rails 4.1, not Rails 4.0!

Since rails 4.1, if you want to rename your application, the only two files you need to modify are config/application.rb:

require File.expand_path('../boot', __FILE__) require 'rails/all' # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. Bundler.require(*Rails.groups) module YourApplicationName # <-- rename it here class Application < Rails::Application ... end end 

and config/initializers/session_store.rb (optional):

# Be sure to restart your server when you modify this file. Rails.application.config.session_store :cookie_store, key: '_your_application_name_session' # <-- rename the key 

For Rails 4.0.x you can use the rename gem and execute the following command:

rails g rename:app_to New-Name 

Update: This change was introduced in Rails 4.1, not Rails 4.0!

Since rails 4.1, if you want to rename your application, the only two files you need to modify are config/application.rb:

require File.expand_path('../boot', __FILE__) require 'rails/all' # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. Bundler.require(*Rails.groups) module YourApplicationName # <-- rename it here class Application < Rails::Application ... end end 

and config/initializers/session_store.rb (optional):

# Be sure to restart your server when you modify this file. Rails.application.config.session_store :cookie_store, key: '_your_application_name_session' # <-- rename the key 

Since rails 4.1, if you want to rename your application, the only two files you need to modify are config/application.rb:

require File.expand_path('../boot', __FILE__) require 'rails/all' # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. Bundler.require(*Rails.groups) module YourApplicationName # <-- rename it here class Application < Rails::Application ... end end 

and config/initializers/session_store.rb (optional):

# Be sure to restart your server when you modify this file. Rails.application.config.session_store :cookie_store, key: '_your_application_name_session' # <-- rename the key 

For Rails 4.0.x you can use the rename gem and execute the following command:

rails g rename:app_to New-Name 
fixed version number
Source Link
Daniel
  • 4.2k
  • 3
  • 29
  • 46

Update: This change was introduced in Rails 4.1, not Rails 4.0!

Since rails 4.1, if you want to rename your application, the only two files you need to modify are config/application.rb:

require File.expand_path('../boot', __FILE__) require 'rails/all' # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. Bundler.require(*Rails.groups) module YourApplicationName # <-- rename it here class Application < Rails::Application ... end end 

and config/initializers/session_store.rb (optional):

# Be sure to restart your server when you modify this file. Rails.application.config.session_store :cookie_store, key: '_your_application_name_session' # <-- rename the key 

Since rails 4, if you want to rename your application, the only two files you need to modify are config/application.rb:

require File.expand_path('../boot', __FILE__) require 'rails/all' # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. Bundler.require(*Rails.groups) module YourApplicationName # <-- rename it here class Application < Rails::Application ... end end 

and config/initializers/session_store.rb (optional):

# Be sure to restart your server when you modify this file. Rails.application.config.session_store :cookie_store, key: '_your_application_name_session' # <-- rename the key 

Update: This change was introduced in Rails 4.1, not Rails 4.0!

Since rails 4.1, if you want to rename your application, the only two files you need to modify are config/application.rb:

require File.expand_path('../boot', __FILE__) require 'rails/all' # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. Bundler.require(*Rails.groups) module YourApplicationName # <-- rename it here class Application < Rails::Application ... end end 

and config/initializers/session_store.rb (optional):

# Be sure to restart your server when you modify this file. Rails.application.config.session_store :cookie_store, key: '_your_application_name_session' # <-- rename the key 
Source Link
Daniel
  • 4.2k
  • 3
  • 29
  • 46
Loading