0

我是 ror 开发的新手..我在 LIVE 服务器上工作...我刚刚通过 sftp 上传了一个文件...在 1 天后服务器突然停止工作...您可以从这里看到错误消息

表明

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.
4

1 回答 1

0

Looking at the error page you seem to be using Rails 2.3? At a guess you have a MySQL database not an SQLite running. You should have the user name and password for the database around somewhere (replace the relevant fields in the 3 sections with them).

Change the database names to reflect your database names.

The server admins might have set a specific socket for MySQL in which case replace the '/tmp/mysql.sock' with the socket number.

Check your Gems to see if the MySQL adapter is installed (you appear to be using Rails 2.3 so try gem list on the terminal for your server - make sure that you are in the root directory for the app). If the MySQL gem is missing use gem install to install it (this will depend on what your hosting provider allows).

The following links are pretty old - targetted towards Rails 2 which you appear to be using.

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
于 2012-05-08T10:09:58.847 回答