我正在使用雲9 IDE來遵循此tutorial。我如何在Cloud 9上運行Sinatra?我在雲9中創建了一個空白工作區,從命令行運行gem install
。但是從命令行運行Sinatra不起作用。啓動服務器後,我注意到它標記Important: use ENV[PORT] as the port and ENV[IP] as the host in your scripts!
。我該如何做這項工作?先謝謝你。在雲9上運行Sinatra應用時出現錯誤9
0
A
回答
0
由於C9窗口說:「...;確保它與$ IP端口$端口的IP地址」,這是不更換$PORT
或$IP
用自己的價值觀,他們值已經定義,您可以使用echo $IP && echo $PORT
進行檢查。
嘗試在Sinatra項目目錄中運行ruby hi.rb -p $PORT -o $IP
。
您也可以定義端口和IP爲環境變量的標誌,你發現說運行export PORT=<port> && export IP=<ip>
命令,然後任何Ruby文件作爲ENV['PORT']
或ENV['IP']
內訪問它們。
注意:因爲當我使用route get '/hi'
沒有工作的c9.io運行,但它在我的本地機器正確地做到了,如果你有同樣的錯誤,儘量只get '/'
某種原因。
相關問題
- 1. 在雲上運行'jekyll build'命令時出現錯誤消息9
- 2. vba:運行時錯誤'9'
- 3. 運行時錯誤9
- 4. 運行時錯誤'9'VBA
- 5. Vlookup運行時錯誤9
- 6. 運行時錯誤'9'。在Excel VBA
- 7. 運行時錯誤9在VBA腳本
- 8. 我有一個雲端9錯誤,而在雲9
- 9. 在sinatra-synchrony上運行jruby上運行sinatra時出現NoMethodError
- 10. 在雲9上安裝Mongoose 9失敗
- 11. 雲9上的pylint錯誤消息9 CS50
- 12. 運行時錯誤'9',下標超出範圍錯誤
- 13. 下標越界(運行時錯誤#9)
- 14. VBA運行時錯誤9(Excel 2007)
- 15. 轉置陣列運行時錯誤'9'
- 16. 循環運行時錯誤9
- 17. 在雲9中運行js ide
- 18. 在雲中運行的Java 9
- 19. 雲9上的子域應用程序
- 20. 訪問雲套件公用數據庫時出現「Not Authenticated」(9/1002)錯誤
- 21. 運行在雲Java的GUI應用程序9
- 22. Excel VBA-運行時間錯誤9(下標超出範圍)
- 23. 運行時錯誤'9'下標超出範圍
- 24. 運行時錯誤9 - 下標超出範圍
- 25. Excel VBA - 運行時錯誤'9',下標超出範圍
- 26. 獲取運行時錯誤9:下標超出範圍
- 27. 宏運行時錯誤'9':下標超出範圍
- 28. 運行時錯誤「9」下標超出範圍
- 29. 運行時錯誤'9':下標超出範圍與WorksheetFunction
- 30. Visual Basic:運行時錯誤'9':「下標超出範圍」