How to change a Ruby on Rails application name?

前端 未结 8 1233
渐次进展
渐次进展 2020-11-30 19:33

I have a Ruby on Rails application that was created using:

rails new old_name -d mysql

Now I want to change the application name to be

8条回答
  •  甜味超标
    2020-11-30 19:54

    To do this, I have used good old shell commands :

    grep -r old_name * | cut -d: -f1 | xargs sed -i .bak 's/old_name/new_name/g'
    

    This command replace the old_name with new_name in all file it finds the old_name. However, it creates a backup file with the extension '.bak'. Those file can be easily removed once you check everything went well.

    The advantage of this, is that it is not 'rails version dependent'.

提交回复
热议问题