4

無法啓動rails控制檯。當我嘗試啓動時,我收到了以下消息:Rails控制檯 - 進程完成退出代碼0

Loading development environment (Rails 3.2.12) 
Process finished with exit code 0 

它退出時沒有任何錯誤。但軌服務器啓動沒有問題:

=> Booting WEBrick 
=> Rails 3.2.12 application starting in development on http://0.0.0.0:3000 
=> Call with -d to detach 
=> Ctrl-C to shutdown server 
[2013-04-26 02:23:44] INFO WEBrick 1.3.1 
[2013-04-26 02:23:44] INFO ruby 1.9.3 (2013-02-22) [x86_64-darwin12.2.0] 
[2013-04-26 02:23:44] INFO WEBrick::HTTPServer#start: pid=2393 port=3000 

我正在運行Mac OS X rvm。 爲什麼rails控制檯可能不工作?

+0

當您運行'ruby script/rails console'而不是'rails console'時會發生什麼? – Subhas 2013-06-04 17:25:04

+0

Nothing 'bash-3.2 $ ruby​​ script/rails console' '加載開發環境(Rails 3.2.12)' 'bash-3.2 $' – 2013-06-04 19:29:27

+0

如果從終端運行'irb',會發生什麼?另外,軌道控制檯運行在新的rails應用程序?嘗試運行'rails new some_app',然後運行'rails c'。 – kwyoung11 2013-06-05 22:00:53

回答

1

如果您使用的是RVM,請嘗試執行rvm implode並重新安裝Ruby和Rails。

+0

所以這是唯一的解決方案 – 2013-06-18 07:13:59

3

您是否嘗試過使用bundle exec?

bundle exec rails c 
+0

Nothing happens 'bash-3.2 $ bundle exec rails c 加載開發環境(Rails 3.2.12) bash-3.2 $' – 2013-06-04 14:21:00

相關問題