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


현재 아마존에서 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:ininvoke_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/activesupport/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 `'

이런 오류가 나옵니다.

  • 2016년 07월 21일에 수정됨
    루비와 파이썬을 좋아합니다. 새로운 언어를 배우는것도 좋아해요. 모바일 게임도 조금 만들어 봤습니다.
  • 2016년 07월 20일에 작성됨

조회수 186


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사이트 입니다. 작성한 답변에 다른 개발자들이 댓글을 작성하거나 좋아요/싫어요를 할 수 있기 때문에 계정을 필요로 합니다.
► 로그인
► 계정만들기
Close