My current project is located in the Projects/project1 directory. I'd like to have it located in Projects/project2. Do just reinstall Rails into that directory?
運行rails new
只需創建在該目錄中一個新的Rails項目:
$ cd Projects
$ rails new project2
您將有一個新的(空)的項目2 Rails應用程序。
I still need access to project1. How do I switch back and forth between the two projects in terms of browser access? Will it be a separate server? Do I have to edit a file to switch?
假設你通過rails server
運行的本地服務器,您可以指定服務器通過-p
上運行的端口。
通過執行
$ ./script/rails server -p 3001
在本地運行多個Rails項目,確保他們都在一個獨特的端口上運行給定一個Rails項目,你可以在localhost:3001
聽。
Anything else you think I might need to know in order to manage multiple projects. Please assume that I know nothing about the setup as I'm just getting started.
根據你的平臺,你應該看看Pow或Passenger它自動在一臺服務器中部署多個Rails應用的過程。
所以我能夠安裝新的項目,但我遇到了端口指令的麻煩。當我運行'$ ./script/rails server -p 3001'時,出現錯誤:'autodetect':無法找到JavaScript運行時。有任何想法嗎? – VirtuosiMedia 2012-02-27 21:47:12
這是一個無關緊要的問題。你要麼要谷歌的解決方案或[問另一個問題](http://stackoverflow.com/questions/ask)。 – meagar 2012-02-27 21:53:56
我最終需要安裝一些額外的寶石。謝謝您的幫助。 – VirtuosiMedia 2012-02-27 21:59:43