简体   繁体   English

运行克隆的红宝石项目时出错

[英]Error running cloned ruby project

I have cloned a ruby on rails project from bitbucket and source tree. 我已经从bitbucket和源代码树克隆了ruby on rails项目。 When I try to run the project, using rails server, I get following error 当我尝试使用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>'

Can anyone tell me what might be the issue? 谁能告诉我可能是什么问题?

Ruby on Rails applications, like most web applications, are usually backed by a database. 像大多数Web应用程序一样,Ruby on Rails应用程序通常由数据库支持。 You specify how to connect to the database in the <project directory>/config/database.yml file. 您可以在<project directory>/config/database.yml文件中指定如何连接数据库。 Since this configuration is usually specific to a particular machine, many projects don't include the file in their public source trees. 由于此配置通常特定于特定机器,因此许多项目不在其公共源树中包含文件。

In this case, you need to create the file and fill in the details yourself. 在这种情况下,您需要创建文件并自己填写详细信息。 See https://gist.github.com/961978 for example database.yml files for different database servers. 有关不同数据库服务器的示例database.yml文件,请参见https://gist.github.com/961978

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM