2
[Rails] 如何重設你的專案名稱
source link: https://blog.niclin.tw/2016/06/05/rails-%E5%A6%82%E4%BD%95%E9%87%8D%E8%A8%AD%E4%BD%A0%E7%9A%84%E5%B0%88%E6%A1%88%E5%90%8D%E7%A8%B1/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Nic Lin's Blog
喜歡在地上滾的工程師
這裡限定Rails版本為4,其餘版本是否支援可能需要在查詢。
在自己做一些小玩具專案的時候,或是專案初期可能名字會有想重新命名的困擾,但是絕對不是把資料夾改個名稱就完成了啊,裡面有些關聯是在你建立專案時就順便建立了。
所以我們只要簡單幾個步驟就可以搞定
打開你欲修改的專案,並且加入Gemfile
gem 'rename'
bundle install
完成後只需輸入
rails g rename:app_to 你想改的名稱
就瞬間完成了,是不是很簡單!
之後就可以把這隻Gem從Gemfile裡拿掉了(以後要改在加入就可以了)
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK