2012-05-08 68 views
0

我是ror開發中的新成員..我正在開發一個LIVE服務器...我剛剛通過sftp上傳了一個文件... 1天后服務器突然停止工作...您可以看到從here錯誤消息Ruby on Rails服務器停止工作

它顯示

There appears to be a database problem. 

Your config/database.yml may not be written correctly. Please check it and fix any errors. 
Your database schema may be out of date or nonexistant. Please run rake db:migrate to ensure that the database schema is up-to-date. 
The database server may not be running. Please check whether it's running, and start it if it isn't. 
+0

你可以粘貼你的'database.yml'和'schema.rb'文件? –

+0

database.yml的 的SQLite 3.x版 #創業板安裝的sqlite3 - 紅寶石(在OS X Leopard的不是必要的) 發展: 適配器:sqlite3的 數據庫:DB/development.sqlite3 池:5 超時:5000 #警告:當您運行「rake」時,定義爲「測試」的數據庫將被刪除,並從您的開發數據庫重新生成# #。 #不要將此數據庫設置爲與開發或生產相同。 測試: 適配器:sqlite3的 數據庫:DB/test.sqlite3 池:5 超時:5000 生產: 適配器:sqlite3的 數據庫:DB/production.sqlite3 池:5 超時:5000 –

+0

'請運行rake db:migrate以確保數據庫模式是最新的.' 您是否嘗試在服務器上運行'rake db:migrate'? –

回答

0

縱觀錯誤頁面,你似乎是使用Rails 2.3? 猜測你有一個MySQL數據庫而不是SQLite運行。你應該在某個地方有數據庫的用戶名和密碼(用它們替換3部分中的相關字段)。

更改數據庫名稱以反映您的數據庫名稱。

服務器管理員可能已經爲MySQL設置了特定的套接字,在這種情況下,用套接字號替換「/tmp/mysql.sock」。

檢查您的Gem以查看是否安裝了MySQL適配器(您似乎在使用Rails 2.3,因此請在終端上爲您的服務器試試gem list - 確保您位於應用程序的根目錄中)。 如果MySQL gem丟失,請使用gem install來安裝它(這將取決於您的託管服務提供商允許的內容)。

以下鏈接相當老 - 針對Rails 2,你似乎正在使用。

http://www.ruby-forum.com/topic/139710

http://forums.mysql.com/read.php?116,353922,359544

的database.yml

development: 
    adapter: mysql 
    encoding: utf8 
    database: temp_development 
    username: root 
    password: 
    socket: /tmp/mysql.sock 

# Warning: The database defined as 'test' will be erased and 
# re-generated from your development database when you run 'rake'. 
# Do not set this db to the same as development or production. 
test: 
    adapter: mysql 
    encoding: utf8 
    database: temp_test 
    username: root 
    password: 
    socket: /tmp/mysql.sock 

production: 
    adapter: mysql 
    encoding: utf8 
    database: temp_production 
    username: root 
    password: 
    socket: /tmp/mysql.sock 
+0

謝謝..實際的問題是,在Linux服務器上的MySQL服務被停止..我剛剛打開它... –

+0

:D歡呼Shoeb - 很高興知道它直到最後 – Pasted