0

我从 bitbucket 和源代码树中克隆了一个 ruby​​ on rails 项目。当我尝试使用 rails 服务器运行项目时,出现以下错误

rails server
=> Booting WEBrick
=> Rails 3.0.10 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/Users/xyz/.rvm/gems/ruby-1.9.3-p194/gems/railties- 3.0.10/lib/rails/application/configuration.rb:88:in `read': No such file or directory -      /Users/xyz/newderbywire/config/database.yml (Errno::ENOENT)
from /Users/xyz/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.10/lib/rails/application/configuration.rb:88:in `database_configuration'
from /Users/xyz/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.0.10/lib/active_record/railtie.rb:58:in `block (2 levels) in <class:Railtie>'
from /Users/xyz/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.10/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval'
from /Users/xyz/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.10/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
from /Users/xyz/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.10/lib/active_support/lazy_load_hooks.rb:26:in `on_load'
from /Users/xyz/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.0.10/lib/active_record/railtie.rb:57:in `block in <class:Railtie>'
from /Users/xyz/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.10/lib/rails/initializable.rb:25:in `instance_exec'
from /Users/xyz/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.10/lib/rails/initializable.rb:25:in `run'
from /Users/xyz/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.10/lib/rails/initializable.rb:50:in `block in run_initializers'
from /Users/xyz/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.10/lib/rails/initializable.rb:49:in `each'
from /Users/xyz/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.10/lib/rails/initializable.rb:49:in `run_initializers'
from /Users/xyz/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.10/lib/rails/application.rb:134:in `initialize!'
from /Users/xyz/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.10/lib/rails/application.rb:77:in `method_missing'
from /Users/xyz/newderbywire/config/environment.rb:5:in `<top (required)>'
from /Users/xyz/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.10/lib/active_support/dependencies.rb:239:in `require'
from /Users/xyz/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.10/lib/active_support/dependencies.rb:239:in `block in require'
from /Users/xyz/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.10/lib/active_support/dependencies.rb:225:in `block in load_dependency'
from /Users/xyz/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.10/lib/active_support/dependencies.rb:593:in `new_constants_in'
from /Users/xyz/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.10/lib/active_support/dependencies.rb:225:in `load_dependency'
from /Users/xyz/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.10/lib/active_support/dependencies.rb:239:in `require'
from /Users/xyz/newderbywire/config.ru:3:in `block in <main>'
from /Users/xyz/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.2.5/lib/rack/builder.rb:46:in `instance_eval'
from /Users/xyz/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.2.5/lib/rack/builder.rb:46:in `initialize'
from /Users/xyz/newderbywire/config.ru:1:in `new'
from /Users/xyz/newderbywire/config.ru:1:in `<main>'
from /Users/xyz/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.2.5/lib/rack/builder.rb:35:in `eval'
from /Users/xyz/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.2.5/lib/rack/builder.rb:35:in `parse_file'
from /Users/xyz/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.2.5/lib/rack/server.rb:162:in `app'
from /Users/xyz/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.2.5/lib/rack/server.rb:253:in `wrapped_app'
from /Users/xyz/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.2.5/lib/rack/server.rb:204:in `start'
from /Users/xyz/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.10/lib/rails/commands/server.rb:65:in `start'
from /Users/xyz/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.10/lib/rails/commands.rb:30:in `block in <top (required)>'
from /Users/xyz/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.10/lib/rails/commands.rb:27:in `tap'
from /Users/xyz/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.10/lib/rails/commands.rb:27:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'

谁能告诉我可能是什么问题?

4

1 回答 1

0

与大多数 Web 应用程序一样,Ruby on Rails 应用程序通常由数据库支持。您在文件中指定如何连接到数据库<project directory>/config/database.yml。由于此配置通常特定于特定机器,因此许多项目不会在其公共源代码树中包含该文件。

在这种情况下,您需要自己创建文件并填写详细信息。有关不同数据库服务器的示例 database.yml 文件,请参见https://gist.github.com/961978

于 2012-10-19T04:04:53.883 回答