2014-04-22 2 views
1
나는 레일에 루비를 실행하고

는 다음과 같은 구성 스택 :데이터베이스 파일이 지정되지 않았습니다. 누락 된 인수 : 데이터베이스

default: &default 
adapter: sqlite3 
pool: 5 
timeout: 5000 

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


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

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

그리고 나는 다음과 같은 오류가 점점 오전 :

==> ruby -v 
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux] 

==> rails -v 
Warning: You're using Rubygems 1.8.23 with Spring. Upgrade to at least Rubygems 2.1.0 and run `gem pristine --all` for better startup performance. 
Rails 4.1.0 

==> gem -v 
1.8.23 

내 설정/database.yml을은 다음과 같습니다 브라우저에서 :

No database file specified. Missing argument: database 

전체 추적은 다음과 같습니다

내가 번들 내 프로젝트의 루트에서 설치 실행하면
`activerecord (4.1.0) lib/active_record/connection_adapters/sqlite3_adapter.rb:14:in `sqlite3_connection' 
activerecord (4.1.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:435:in `new_connection' 
activerecord (4.1.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:445:in `checkout_new_connection' 
activerecord (4.1.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:416:in `acquire_connection' 
activerecord (4.1.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:351:in `block in checkout' 
/usr/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize' 
activerecord (4.1.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:350:in `checkout' 
activerecord (4.1.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:265:in `block in connection' 
/usr/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize' 
activerecord (4.1.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:264:in `connection' 
activerecord (4.1.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:541:in `retrieve_connection' 
activerecord (4.1.0) lib/active_record/connection_handling.rb:113:in `retrieve_connection' 
activerecord (4.1.0) lib/active_record/connection_handling.rb:87:in `connection' 
activerecord (4.1.0) lib/active_record/query_cache.rb:51:in `restore_query_cache_settings' 
activerecord (4.1.0) lib/active_record/query_cache.rb:43:in `rescue in call' 
activerecord (4.1.0) lib/active_record/query_cache.rb:32:in `call' 
activerecord (4.1.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:621:in `call' 
activerecord (4.1.0) lib/active_record/migration.rb:380:in `call' 
actionpack (4.1.0) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call' 
activesupport (4.1.0) lib/active_support/callbacks.rb:82:in `run_callbacks' 
actionpack (4.1.0) lib/action_dispatch/middleware/callbacks.rb:27:in `call' 
actionpack (4.1.0) lib/action_dispatch/middleware/reloader.rb:73:in `call' 
actionpack (4.1.0) lib/action_dispatch/middleware/remote_ip.rb:76:in `call' 
actionpack (4.1.0) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call' 
actionpack (4.1.0) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call' 
railties (4.1.0) lib/rails/rack/logger.rb:38:in `call_app' 
railties (4.1.0) lib/rails/rack/logger.rb:20:in `block in call' 
activesupport (4.1.0) lib/active_support/tagged_logging.rb:68:in `block in tagged' 
activesupport (4.1.0) lib/active_support/tagged_logging.rb:26:in `tagged' 
activesupport (4.1.0) lib/active_support/tagged_logging.rb:68:in `tagged' 
railties (4.1.0) lib/rails/rack/logger.rb:20:in `call' 
actionpack (4.1.0) lib/action_dispatch/middleware/request_id.rb:21:in `call' 
rack (1.5.2) lib/rack/methodoverride.rb:21:in `call' 
rack (1.5.2) lib/rack/runtime.rb:17:in `call' 
activesupport (4.1.0) lib/active_support/cache/strategy/local_cache_middleware.rb:26:in `call' 
rack (1.5.2) lib/rack/lock.rb:17:in `call' 
actionpack (4.1.0) lib/action_dispatch/middleware/static.rb:64:in `call' 
rack (1.5.2) lib/rack/sendfile.rb:112:in `call' 
railties (4.1.0) lib/rails/engine.rb:514:in `call' 
railties (4.1.0) lib/rails/application.rb:144:in `call' 
/usr/lib/ruby/vendor_ruby/phusion_passenger/rack/request_handler.rb:96:in `process_request' 
/usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_request_handler.rb:516:in `accept_and_process_next_request' 
/usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_request_handler.rb:274:in `main_loop' 
/usr/lib/ruby/vendor_ruby/phusion_passenger/rack/application_spawner.rb:206:in `start_request_handler' 
/usr/lib/ruby/vendor_ruby/phusion_passenger/rack/application_spawner.rb:171:in `block in handle_spawn_application' 
/usr/lib/ruby/vendor_ruby/phusion_passenger/utils.rb:479:in `safe_fork' 
/usr/lib/ruby/vendor_ruby/phusion_passenger/rack/application_spawner.rb:166:in `handle_spawn_application' 
/usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server.rb:357:in `server_main_loop' 
/usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server.rb:206:in `start_synchronously' 
/usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server.rb:180:in `start' 
/usr/lib/ruby/vendor_ruby/phusion_passenger/rack/application_spawner.rb:129:in `start' 
/usr/lib/ruby/vendor_ruby/phusion_passenger/spawn_manager.rb:253:in `block (2 levels) in spawn_rack_application' 
/usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add' 
/usr/lib/ruby/vendor_ruby/phusion_passenger/spawn_manager.rb:246:in `block in spawn_rack_application' 
/usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server_collection.rb:82:in `block in synchronize' 
<internal:prelude>:10:in `synchronize' 
/usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server_collection.rb:79:in `synchronize' 
/usr/lib/ruby/vendor_ruby/phusion_passenger/spawn_manager.rb:244:in `spawn_rack_application' 
/usr/lib/ruby/vendor_ruby/phusion_passenger/spawn_manager.rb:137:in `spawn_application' 
/usr/lib/ruby/vendor_ruby/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application' 
/usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server.rb:357:in `server_main_loop' 
/usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server.rb:206:in `start_synchronously' 
/usr/share/phusion-passenger/helper-scripts/passenger-spawn-server:99:in `<main>` 

는, 결과는 다음과 같다 :

==> bundle install 
Using rake 10.3.1 
Using i18n 0.6.9 
Using json 1.8.1 
Using minitest 5.3.3 
Using thread_safe 0.3.3 
Using tzinfo 1.1.0 
Using activesupport 4.1.0 
Using builder 3.2.2 
Using erubis 2.7.0 
Using actionview 4.1.0 
Using rack 1.5.2 
Using rack-test 0.6.2 
Using actionpack 4.1.0 
Using mime-types 1.25.1 
Using polyglot 0.3.4 
Using treetop 1.4.15 
Using mail 2.5.4 
Using actionmailer 4.1.0 
Using activemodel 4.1.0 
Using arel 5.0.1.20140414130214 
Using activerecord 4.1.0 
Using coffee-script-source 1.7.0 
Using execjs 2.0.2 
Using coffee-script 2.2.0 
Using thor 0.19.1 
Using railties 4.1.0 
Using coffee-rails 4.0.1 
Using hike 1.2.3 
Using multi_json 1.9.2 
Using jbuilder 2.0.6 
Using jquery-rails 3.1.0 
Using bundler 1.6.2 
Using tilt 1.4.1 
Using sprockets 2.11.0 
Using sprockets-rails 2.1.3 
Using rails 4.1.0 
Using rdoc 4.1.1 
Using sass 3.2.19 
Using sass-rails 4.0.3 
Using sdoc 0.4.0 
Using spring 1.1.2 
Using sqlite3 1.3.9 
Using turbolinks 2.2.2 
Using uglifier 2.5.0 
Your bundle is complete! 
Use `bundle show [gemname]` to see where a bundled gem is installed. 
+0

데이터베이스 클리너를 사용하여 테스트 사례를 실행하려고합니까? – aelor

+0

아니요. 그냥 레일스 새 앱을 사용하여 기본 레일 앱을 만들고 브라우저에서 보려고했습니다. – Das

답변

1

내가 기본은 또한 데이터베이스 키를 포함한다고 가정한다. 이것은 또한 유효한 데이터베이스 구성으로 간주됩니다.

default: &default 
adapter: sqlite3 
pool: 5 
timeout: 5000 

참조 : http://rails-bestpractices.com/posts/37-dry-your-database-yml 당신이 당신의 기본 데이터베이스에 database: 매개 변수를 추가 한 경우 내가 도움이 될 궁금

+0

어째서 ... 기본값에도 데이터베이스 키가 있어야합니다. – Das

+0

기본 해시 안에'database : db/default.sqlite3'를 추가하십시오. 어댑터, 풀 및 시간 초과를 추가 한 것과 같습니다. 키의 값은 해당 개발, 테스트 또는 프로덕션 데이터베이스 값에 의해 자동으로 대체됩니다. – SreekanthGS

+0

나는 그것을 시험해 보았다. 하지만 같은 오류가 발생합니다. Ran rake db : 마이그레이션. – Das

1

? (그냥 추측)

default: &default 
adapter: sqlite3 
pool: 5 
timeout: 5000 
database: xxx 
+0

나는 그것을 시도했다. 그것은 작동하지 않았다. – Das

관련 문제