2014-09-20 57 views
0

我在Ubuntu 10.04中安裝了Rails。並且有一些應用程序正在運行。但在將Ubuntu更新到14.04後,rails應用程序無法正常工作。將Ubuntu從10.04更新到14.04後Rails無法正常工作

當我嘗試啓動我的Rails應用程序(如$軌道服務器),我得到以下警告和幫助:

bin/rails:6: warning: already initialized constant APP_PATH 
/home/razor/rails_projs/simple_cms/bin/rails:6: warning: previous definition of APP_PATH was here 
Usage: rails COMMAND [ARGS] 

The most common rails commands are: 
generate Generate new code (short-cut alias: "g") 
console  Start the Rails console (short-cut alias: "c") 
server  Start the Rails server (short-cut alias: "s") 
dbconsole Start a console for the database specified in config/database.yml 
     (short-cut alias: "db") 
new   Create a new Rails application. "rails new my_app" creates a 
     new application called MyApp in "./my_app" 

In addition to those, there are: 
application Generate the Rails application code 
destroy  Undo code generated with "generate" (short-cut alias: "d") 
plugin new Generates skeleton for developing a Rails plugin 
runner  Run a piece of code in the application environment (short-cut alias: "r") 

All commands can be run with -h (or --help) for more information. 
+0

在將ubuntu更新到14.04時,它詢問我是否要刪除一些過時的軟件包。並選擇是的,這很重要嗎? – rAzOr 2014-09-20 15:38:49

回答

0

這發生在我身上時,我錯誤地試圖從外部運行軌道服務器app目錄,然後再從一個gem/engine目錄中找到。你能確認你在你的主應用程序內嗎?看起來你是,如果你的應用名稱是simple_cms。

如果是這樣,那麼你得到了什麼,當你運行

type rails 

which rails 

它的怪異,它使您能夠從一個應用程序中創建一個應用程序的選項,這ISN」可能。你安裝了哪個版本的導軌?

+0

是的,我從我的應用程序內運行rails服務器。命令的輸出如下: $ type rails 'rails hashed(/home/razor/.rvm/gems/ruby-2.1.2/bin/rails)' $ which rails '/ home/razor/.rvm/gems/ruby​​-2.1.2/bin/rails' – rAzOr 2014-09-20 17:41:25

+0

你也可以給我rails版嗎?我認爲這個命令是rails -v,也是你的應用程序使用的rails版本。你是否也可以嘗試在其中創建一個新的rails應用程序和運行rails服務器。 – CleoR 2014-09-21 01:43:47

+0

Rails版本:'4.1.6' 嘗試使用新應用程序,即使這樣也會得到相同的結果。 – rAzOr 2014-09-21 04:16:37

0

This link,幫我解決了這個問題。 我不得不卸載mysql2寶石,然後重新安裝它。

命令我用

$gem uninstall mysql2 
$gem install mysql2 

比一切都很好,可以啓動服務器。