루비온레일즈 rds mysql 연결하기

조회수 1475회

현재 아마존에서 rds를 할당받아 루비온레일즈에서 사용하고 싶은대 database.yml 파일을 정확히 어떻게 수정해야할지 모르겠습니다. 현재 에는

adapter: mysql

database: "데이터베이스이름"

host : "crmvw9kjjl.ap-northeast-2.rds.amz 이런식으로 할당받은 주소"

username : "유저이름"

password : "비밀번호"

encoding : utf8

pool: 5

timeout: 5000

이런식으로 development와 test production을 모두 수정하였는대 /usr/local/rvm/gems/ruby-2.0.0-p648/gems/activerecord-4.0.1/lib/active_record/connection_adapters/connection_specification.rb:44:in resolve_string_connection': development database is not configured (ActiveRecord::AdapterNotSpecified) from /usr/local/rvm/gems/ruby-2.0.0-p648/gems/activerecord-4.0.1/lib/active_record/connection_adapters/connection_specification.rb:30:inspec' from /usr/local/rvm/gems/ruby-2.0.0-p648/gems/activerecord-4.0.1/lib/active_record/connection_handling.rb:39:in establish_connection' from /usr/local/rvm/gems/ruby-2.0.0-p648/gems/activerecord-4.0.1/lib/active_record/railtie.rb:176:inblock (2 levels) in class:Railtie' from /usr/local/rvm/gems/ruby-2.0.0-p648/gems/activesupport-4.0.1/lib/active_support/lazy_load_hooks.rb:38:in instance_eval' from /usr/local/rvm/gems/ruby-2.0.0-p648/gems/activesupport-4.0.1/lib/active_support/lazy_load_hooks.rb:38:inexecute_hook' from /usr/local/rvm/gems/ruby-2.0.0-p648/gems/activesupport-4.0.1/lib/active_support/lazy_load_hooks.rb:45:in block in run_load_hooks' from /usr/local/rvm/gems/ruby-2.0.0-p648/gems/activesupport-4.0.1/lib/active_support/lazy_load_hooks.rb:44:ineach' from /usr/local/rvm/gems/ruby-2.0.0-p648/gems/activesupport-4.0.1/lib/active_support/lazy_load_hooks.rb:44:in run_load_hooks' from /usr/local/rvm/gems/ruby-2.0.0-p648/gems/activerecord-4.0.1/lib/active_record/base.rb:322:inmodule:ActiveRecord' from /usr/local/rvm/gems/ruby-2.0.0-p648/gems/activerecord-4.0.1/lib/active_record/base.rb:22:in <top (required)>' from /usr/local/rvm/gems/ruby-2.0.0-p648/gems/railties-4.0.1/lib/rails/generators/named_base.rb:172:inpluralize_table_names?' from /usr/local/rvm/gems/ruby-2.0.0-p648/gems/railties-4.0.1/lib/rails/generators/named_base.rb:112:in table_name' from /usr/local/rvm/gems/ruby-2.0.0-p648/gems/activerecord-4.0.1/lib/rails/generators/active_record/model/model_generator.rb:18:increate_migration_file' from /usr/local/rvm/gems/ruby-2.0.0-p648/gems/thor-0.19.1/lib/thor/command.rb:27:in run' from /usr/local/rvm/gems/ruby-2.0.0-p648/gems/thor-0.19.1/lib/thor/invocation.rb:126:ininvoke_command' from /usr/local/rvm/gems/ruby-2.0.0-p648/gems/thor-0.19.1/lib/thor/invocation.rb:133:in block in invoke_all' from /usr/local/rvm/gems/ruby-2.0.0-p648/gems/thor-0.19.1/lib/thor/invocation.rb:133:ineach' from /usr/local/rvm/gems/ruby-2.0.0-p648/gems/thor-0.19.1/lib/thor/invocation.rb:133:in map' from /usr/local/rvm/gems/ruby-2.0.0-p648/gems/thor-0.19.1/lib/thor/invocation.rb:133:ininvoke_all' from /usr/local/rvm/gems/ruby-2.0.0-p648/gems/thor-0.19.1/lib/thor/group.rb:232:in dispatch' from /usr/local/rvm/gems/ruby-2.0.0-p648/gems/thor-0.19.1/lib/thor/invocation.rb:115:ininvoke' from /usr/local/rvm/gems/ruby-2.0.0-p648/gems/thor-0.19.1/lib/thor/group.rb:277:in block in _invoke_for_class_method' from /usr/local/rvm/gems/ruby-2.0.0-p648/gems/thor-0.19.1/lib/thor/shell.rb:68:inwith_padding' from /usr/local/rvm/gems/ruby-2.0.0-p648/gems/thor-0.19.1/lib/thor/group.rb:266:in _invoke_for_class_method' from /usr/local/rvm/gems/ruby-2.0.0-p648/gems/thor-0.19.1/lib/thor/group.rb:133:in_invoke_from_option_orm' from /usr/local/rvm/gems/ruby-2.0.0-p648/gems/thor-0.19.1/lib/thor/command.rb:27:in run' from /usr/local/rvm/gems/ruby-2.0.0-p648/gems/thor-0.19.1/lib/thor/invocation.rb:126:ininvoke_command' from /usr/local/rvm/gems/ruby-2.0.0-p648/gems/thor-0.19.1/lib/thor/invocation.rb:133:in block in invoke_all' from /usr/local/rvm/gems/ruby-2.0.0-p648/gems/thor-0.19.1/lib/thor/invocation.rb:133:ineach' from /usr/local/rvm/gems/ruby-2.0.0-p648/gems/thor-0.19.1/lib/thor/invocation.rb:133:in map' from /usr/local/rvm/gems/ruby-2.0.0-p648/gems/thor-0.19.1/lib/thor/invocation.rb:133:ininvoke_all' from /usr/local/rvm/gems/ruby-2.0.0-p648/gems/thor-0.19.1/lib/thor/group.rb:232:in dispatch' from /usr/local/rvm/gems/ruby-2.0.0-p648/gems/thor-0.19.1/lib/thor/base.rb:440:instart' from /usr/local/rvm/gems/ruby-2.0.0-p648/gems/railties-4.0.1/lib/rails/generators.rb:156:in invoke' from /usr/local/rvm/gems/ruby-2.0.0-p648/gems/railties-4.0.1/lib/rails/commands/generate.rb:11:in' from /usr/local/rvm/gems/ruby-2.0.0-p648/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in require' from /usr/local/rvm/gems/ruby-2.0.0-p648/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:inblock in require' from /usr/local/rvm/gems/ruby-2.0.0-p648/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:214:in load_dependency' from /usr/local/rvm/gems/ruby-2.0.0-p648/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:inrequire' from /usr/local/rvm/gems/ruby-2.0.0-p648/gems/railties-4.0.1/lib/rails/commands.rb:48:in <top (required)>' from bin/rails:4:inrequire' from bin/rails:4:in `'

이런 오류가 나옵니다.

1 답변

    1. database.yml에서 development 환경에 관한 설정을 해주셨나요?
    2. database.yml 안의 인덴션을 맞춰 주셨나요? 인덴션에 탭을 썼다거나, 불필요한 공백이 들어가 있지 않은가요?
    • (•́ ✖ •̀)
      알 수 없는 사용자
    • 탭이 들어갔을수도 있을거같아서 탭이 들어갔을만한 부분을 모두 지워버리고 development환경과 production test 모두 수정을 해보았지만 여전히 같은 오류가 납니다. 현재 환경부분에서 설정해준것은 adapter, database, host, username, password, encoding, port, pool을 해주었습니다 getampain 2016.7.20 23:27

답변을 하려면 로그인이 필요합니다.

Hashcode는 개발자들을 위한 무료 QnA 사이트입니다. 계정을 생성하셔야만 답변을 작성하실 수 있습니다.

(ಠ_ಠ)
(ಠ‿ಠ)

ᕕ( ᐛ )ᕗ
로그인이 필요합니다

Hashcode는 개발자들을 위한 무료 QnA사이트 입니다. 계정을 생성하셔야만 글을 작성하실 수 있습니다.