![](/img/trans.png)
[英]The program 'rails' is currently not installed in the root of a Rails app folder
[英]Rails app accidentally installed in root folder
我不小心在根目錄中創建了一個Rails應用程序。 我運行了以下命令,但出現錯誤:
rails new test_app
Can't initialize a new Rails application within the directory of another, please change to a non-Rails directory first.
所以我嘗試跑步
bundle exec rails server
看起來服務器正在偵聽端口3000。
如何從根目錄中刪除此應用程序?
只需刪除文件夾,或者您可以執行此命令
rm -rf test_app
希望您使用基於* nix的系統。
使用以下命令停止正在運行的服務器:
kill -9 $(lsof -t -i :3000)
使用以下命令將工作目錄更改為根目錄:
cd /
或將根定義為的位置。
使用以下命令刪除意外創建的Rails應用程序目錄:
rm -fr rails_project_in_root_dir
其中rails_project_in_root_dir
是您的根目錄中的Rails應用程序目錄。
好的,我不確定它是如何安裝在根目錄中的,但是我最終只是手動刪除了在運行時創建的所有文件夾和文件
rails new app
在這里找到文件列表:
http://guides.rubyonrails.org/getting_started.html
最終解決了這個問題。 感謝您的幫助。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.