Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/64.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 代码传递生成失败,出现NodeDatabaseError_Ruby On Rails_Codeship - Fatal编程技术网

Ruby on rails 代码传递生成失败,出现NodeDatabaseError

Ruby on rails 代码传递生成失败,出现NodeDatabaseError,ruby-on-rails,codeship,Ruby On Rails,Codeship,my rails应用程序的构建失败,运行测试时出现以下错误 9) FailedKeyChecks should contain a value Failure/Error: ActiveRecord::Base.connection.execute(query) ActiveRecord::NoDatabaseError: FATAL: database "myapp_development" does not exist 10) User is invalid without nam

my rails应用程序的构建失败,运行测试时出现以下错误

9) FailedKeyChecks should contain a value
Failure/Error: ActiveRecord::Base.connection.execute(query)

ActiveRecord::NoDatabaseError:
  FATAL:  database "myapp_development" does not exist

10) User is invalid without name
Failure/Error: raise ActiveRecord::NoDatabaseError.new(error.message, error)

ActiveRecord::NoDatabaseError:
  FATAL:  database "myapp_development" does not exist
我做错了什么?我的
codeship.database.yml
文件

development:
  adapter: postgresql
  host: localhost
  encoding: unicode
  pool: 10
  username: <%= ENV['PG_USER'] %>
  template: template1
  password: <%= ENV['PGPASSWORD'] %>
  database: development<%= ENV['TEST_ENV_NUMBER'] %>
  port: <%= ENV['DATABASE_PORT'] %>
  sslmode: disable
test:
  adapter: postgresql
  host: localhost
  encoding: unicode
  pool: 10
  username: <%= ENV['PG_USER'] %>
  template: template1
  password: <%= ENV['PGPASSWORD'] %>
  database: test<%= ENV['TEST_ENV_NUMBER'] %>
  port: <%= ENV['DATABASE_PORT'] %>
  sslmode: disable
和我的
测试命令

RAILS_ENV=test bundle exec rake
RAILS_ENV=test bundle exec rspec

知道为什么要引用开发数据库吗?提前感谢

尝试运行
bundle exec rake db:create:all
然后是
bundle exec rake db:migrate

它可能失败了,因为您忘记了“全部”

请尝试运行
bundle exec rake db:create:all
然后是
bundle exec rake db:migrate

它可能失败了,因为您忘记了“全部”

谢谢您的快速响应,但是,它不会改变任何事情。对于快速响应,它不会改变任何事情
RAILS_ENV=test bundle exec rake
RAILS_ENV=test bundle exec rspec