私はセットアップしている新しいレール環境を持っています。私はRSPECテストを実行しているときにデータベースに接続しているpostgresにいくつか問題があります。私はすべてのエラーを受け取るrake db:migrate
を実行することができず、Postgres on Rails致命的:データベース "my_app_test"が存在しません
test:
adapter: postgresql
encoding: unicode
database: myapp_com_test
min_messages: WARNING
pool: 5
username:
password:
:
私の環境では、私のdatabase.ymlのファイルがどのように見えるルビー2.2.4p230、Railsの3.2.22、Postgresqlの9.4.5
です。
私もrails c test
を実行することができますし、コンソールが起動しているようだと私を示しています
Digest::Digest is deprecated; use Digest
Loading test environment (Rails 3.2.22)
[1] pry(main)>
しかし、私はrake db:test:prepare
ような何かを実行すると、それはその端末ウィンドウで正常に動作ように見えますが、私は中FATAL: database "myapp_com_test" does not exist
を受け取りますサーバーウィンドウ。私はrake spec
を実行したときと同じ線に沿って
は、私はここで何が起こっているか任意のアイデアこのエラー
Connecting to database specified by database.yml
(0.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
(0.6ms) SELECT version FROM schema_migrations ORDER BY version
(126.3ms) DROP DATABASE IF EXISTS "myapp_com_test"
(236.5ms) CREATE DATABASE "myapp_com_test" ENCODING = 'unicode'
/Users/ryanfitch/.rvm/rubies/ruby-2.2.4/bin/ruby -S rspec ./spec/controllers/account_controller_spec.rb ./spec/controllers/artists_controller_spec.rb ./spec/controllers/contact_controller_spec.rb ./spec/controllers/exclusivities_controller_spec.rb ./spec/controllers/help_controller_spec.rb ./spec/controllers/home_controller_spec.rb ./spec/controllers/legal_controller_spec.rb ./spec/controllers/line_items_controller_spec.rb ./spec/controllers/mixtapes_controller_spec.rb ./spec/controllers/newsletter_controller_spec.rb ./spec/controllers/order_controller_spec.rb ./spec/controllers/originals_controller_spec.rb ./spec/controllers/registrations_controller_spec.rb ./spec/controllers/stations_controller_spec.rb ./spec/controllers/story_controller_spec.rb ./spec/controllers/tracks_controller_spec.rb ./spec/controllers/users_controller_spec.rb ./spec/decorators/exclusivities_decorator_spec.rb ./spec/decorators/station_decorator_spec.rb ./spec/features/user_creates_account_spec.rb ./spec/features/user_places_click_order_spec.rb ./spec/helpers/exclusivities_helper_spec.rb ./spec/helpers/stations_helper_spec.rb ./spec/models/address_spec.rb ./spec/models/artist_spec.rb ./spec/models/billing_information_spec.rb ./spec/models/exclusivity_spec.rb ./spec/models/license_spec.rb ./spec/models/line_item_spec.rb ./spec/models/mixtape_download_spec.rb ./spec/models/mixtape_spec.rb ./spec/models/order_spec.rb ./spec/models/outbox_spec.rb ./spec/models/promo_code_spec.rb ./spec/models/side_spec.rb ./spec/models/station_spec.rb ./spec/models/track_rank_spec.rb ./spec/models/track_spec.rb ./spec/models/user_spec.rb ./spec/models/vendor_spec.rb ./spec/routing/artists_routing_spec.rb ./spec/routing/contact_routing_spec.rb ./spec/routing/help_routing_spec.rb ./spec/routing/home_routing_spec.rb ./spec/routing/legal_routing_spec.rb ./spec/routing/mixtapes_routing_spec.rb ./spec/routing/originals_routing_spec.rb ./spec/routing/story_routing_spec.rb ./spec/routing/tracks_routing_spec.rb ./spec/views/stations/play.html.erb_spec.rb
invalid option: --no-fail-fast
Please use --help for a listing of valid options
/Users/ryanfitch/.rvm/rubies/ruby-2.2.4/bin/ruby -S rspec ./spec/controllers/account_controller_spec.rb ./spec/controllers/artists_controller_spec.rb ./spec/controllers/contact_controller_spec.rb ./spec/controllers/exclusivities_controller_spec.rb ./spec/controllers/help_controller_spec.rb ./spec/controllers/home_controller_spec.rb ./spec/controllers/legal_controller_spec.rb ./spec/controllers/line_items_controller_spec.rb ./spec/controllers/mixtapes_controller_spec.rb ./spec/controllers/newsletter_controller_spec.rb ./spec/controllers/order_controller_spec.rb ./spec/controllers/originals_controller_spec.rb ./spec/controllers/registrations_controller_spec.rb ./spec/controllers/stations_controller_spec.rb ./spec/controllers/story_controller_spec.rb ./spec/controllers/tracks_controller_spec.rb ./spec/controllers/users_controller_spec.rb ./spec/decorators/exclusivities_decorator_spec.rb ./spec/decorators/station_decorator_spec.rb ./spec/features/user_creates_account_spec.rb ./spec/features/user_places_click_order_spec.rb ./spec/helpers/exclusivities_helper_spec.rb ./spec/helpers/stations_helper_spec.rb ./spec/models/address_spec.rb ./spec/models/artist_spec.rb ./spec/models/billing_information_spec.rb ./spec/models/exclusivity_spec.rb ./spec/models/license_spec.rb ./spec/models/line_item_spec.rb ./spec/models/mixtape_download_spec.rb ./spec/models/mixtape_spec.rb ./spec/models/order_spec.rb ./spec/models/outbox_spec.rb ./spec/models/promo_code_spec.rb ./spec/models/side_spec.rb ./spec/models/station_spec.rb ./spec/models/track_rank_spec.rb ./spec/models/track_spec.rb ./spec/models/user_spec.rb ./spec/models/vendor_spec.rb ./spec/routing/artists_routing_spec.rb ./spec/routing/contact_routing_spec.rb ./spec/routing/help_routing_spec.rb ./spec/routing/home_routing_spec.rb ./spec/routing/legal_routing_spec.rb ./spec/routing/mixtapes_routing_spec.rb ./spec/routing/originals_routing_spec.rb ./spec/routing/story_routing_spec.rb ./spec/routing/tracks_routing_spec.rb ./spec/views/stations/play.html.erb_spec.rb failed
とともに、サーバ・ウィンドウに同じFATAL: database "myapp_com_test" does not exist
を受けますか?
EDIT: 私はrails db test
を実行することができますし、テスト・データベースとのdevのデータベースがあると作業しているように見えるので、それはデータベースコンソールを開き、私のスキーマを示して - しかし、Postgresはまだ見つけていないようですそれは何らかの理由でrake spec
を実行したときに発生します。
あなたがあなたの質問のタイトルが示すように、それは 'myapp_com_test'なく' my_app_test'と呼ばれていますよろしいですか? – Cyzanfar