没有这样的文件或目录@ rb_sysopen

时间:2014-08-19 20:34:48

标签: ruby-on-rails rvm

当我运行rails server命令时,我得到了这个错误。我怎么能摆脱它

=> Booting Thin
=> Rails 3.2.11 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/Users//.rvm/gems/ruby-2.1.2/gems/railties-3.2.11/lib/rails/application/configuration.rb:115:in `read': No such file or directory @ rb_sysopen - /Users/Documents/rails/angular-rails-seed/config/database.yml (Errno::ENOENT)

1 个答案:

答案 0 :(得分:4)

您的config/database.yml文件丢失了。重新创建它。默认database.yml如下所示:

# SQLite version 3.x
#   gem install sqlite3
#
#   Ensure the SQLite 3 gem is defined in your Gemfile
#   gem 'sqlite3'
#
default: &default
  adapter: sqlite3
  pool: 5
  timeout: 5000

development:
  <<: *default
  database: db/development.sqlite3

# 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:
  <<: *default
  database: db/test.sqlite3

production:
  <<: *default
  database: db/production.sqlite3