Ruby on Rails服务器停止工作

时间:2012-05-08 06:42:18

标签: ruby-on-rails ruby

我是ror developement的新手..我正在使用LIVE服务器...我刚刚通过sftp上传了一个文件... 1天服务器突然停止工作后...你可以看到来自{{的错误消息3}}

显示

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.

1 个答案:

答案 0 :(得分:0)

查看错误页面,您似乎正在使用Rails 2.3? 猜测你有一个MySQL数据库而不是SQLite运行。你应该在某个地方拥有数据库的用户名和密码(用它们替换3个部分中的相关字段)。

更改数据库名称以反映您的数据库名称。

服务器管理员可能为MySQL设置了一个特定的套接字,在这种情况下用套接字号替换'/tmp/mysql.sock'。

检查您的Gems以查看是否安装了MySQL适配器(您似乎正在使用Rails 2.3,因此请在终端上为您的服务器尝试gem列表 - 确保您位于应用程序的根目录中)。 如果缺少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