Home>
I renamed the old project name part of the contents of all files other than the cache to the new project name with grep -rl.
Rails s still gives me a site not found error.
Postscript: Excuse me.
I have a project called hoge, but I wanted to rename it to fuga, and I wondered if it would work just by changing the routing part.
hoge/config/initializers/hoge.rb
Rails.application.configure do
config.hoge = {
staff: {host: "hoge.test.com", path: ""},
admin: {host: "hoge.test.com", path: "admin"}
}
end
routes.rb
Rails.application.routes.draw do
config = Rails.application.config.hoge
constraints host: config [: staff] [: host] do
namespace: staff, path: config [: staff] [: path] do
root "top # index"
end
end
constraints host: config [: admin] [: host] do
namespace: admin, path: config [: admin] [: path] do
root "top # index"
end
end
end
Replaced hoge part with fuga including file name. The rails server starts, but I can't connect with the above address.
-
Answer # 1
Related articles
- ruby on rails - rspec test changed by -1, but was changed by 0 error
- ruby on rails - when i changed the data type, i got an sql error i don't know where the cause is
- ruby on rails 5 - the path is changed by redirect_to of rails
- new project is not created in ruby on rails
- ruby on rails - rails s can't
- ruby on rails - it is not saved in the database after registering the product
- ruby on rails - mvc rails
- ruby on rails - rails6 rspec model run-time error nomethoderror: undefined method `valid?'for nil: nilclass
- ruby - rails tutorial chapter 2 (6th edition)
- ruby on rails - saved description in nested controller
- ruby on rails - cart function routing error cannot be resolved
- ruby on rails - i want to implement a function for administrator users to register luggage for general users in rails
- ruby on rails - how to transition from the top page
- ruby on rails - heroku: how to check the database_url used for regular backup
- ruby on rails - things associated with a foreign key cannot be called in view
- ruby on rails 6 - environment construction of ruby on rails
- ruby on rails 5 - actioncontroller :: invalidauthenticitytoken cannot be resolved
- ruby on rails - error in controller when transitioning with rails6 destory action
- ruby on rails - access fails after seed after deploying to heroku
Trends
- python - you may need to restart the kernel to use updated packages error
- php - coincheck api authentication doesn't work
- php - i would like to introduce the coincheck api so that i can make payments with bitcoin on my ec site
- [php] i want to get account information using coincheck api
- the emulator process for avd pixel_2_api_29 was killed occurred when the android studio emulator was started, so i would like to
- javascript - how to check if an element exists in puppeteer
- dart - flutter: the instance member'stars' can't be accessed in an initializer error
- sh - 'apt-get' is not recognized as an internal or external command, operable program or batch file
- i want to call a child component method from a parent in vuejs
- python 3x - typeerror: 'method' object is not subscriptable
If you have a question "I want to change the project name", please use the rename gem after returning it to a working state with the original project name hoge.
Official: https://github.com/morshedalam/rename/
How to use: https://qiita.com/ryoya-s/items/66e426f1a0dd5d87cd6f