SQLITE3 DB를 Heroku로 밀어 넣는 문제 : lib/taps/schema.rb : 30 : in`sqlite_config ': nil : nilclass (nilclass)의 정의되지 않은 메소드`[]'

StackOverflow https://stackoverflow.com/questions/1634693

  •  06-07-2019
  •  | 
  •  

문제

Heroku에 배포하려는 SQLITE3 데이터베이스를 치는 Sinatra Datamapper 앱이 있습니다. 첫 번째 패스, 나는 GIT Repo에 데이터베이스 파일을 포함시켰다. 이것은 앱에서와 같이 작동하지만 프로덕션 데이터는 저장소에 속하지 않습니다. 데이터베이스가 읽기 전용이기 때문에 실제로 작동하지 않습니다.

그런 다음 소스 컨트롤을 위해 DB 파일을 제거하고 heroku db:push sqlite://db/my-app.db. 이 명령은 다음과 같은 안정적인 추적을 산출합니다.

my-app/(master) ~ heroku db:push sqlite:://db/my-app.db 
Sending schema
/Library/Ruby/Gems/1.8/gems/taps-0.2.19/lib/taps/../../bin/../lib/taps/schema.rb:30:in `sqlite_config': undefined method `[]' for nil:NilClass (NoMethodError)
    from /Library/Ruby/Gems/1.8/gems/taps-0.2.19/lib/taps/../../bin/../lib/taps/schema.rb:24:in `create_config'
    from /Library/Ruby/Gems/1.8/gems/taps-0.2.19/lib/taps/../../bin/../lib/taps/schema.rb:36:in `connection'
    from /Library/Ruby/Gems/1.8/gems/taps-0.2.19/lib/taps/../../bin/../lib/taps/schema.rb:43:in `dump'
    from /Library/Ruby/Gems/1.8/gems/taps-0.2.19/lib/taps/../../bin/../lib/taps/schema.rb:52:in `dump_without_indexes'
    from /Library/Ruby/Gems/1.8/gems/taps-0.2.19/lib/taps/../../bin/schema:24
Sending data
0 tables, 0 records
Sending indexes
/Library/Ruby/Gems/1.8/gems/taps-0.2.19/lib/taps/../../bin/../lib/taps/schema.rb:30:in `sqlite_config': undefined method `[]' for nil:NilClass (NoMethodError)
    from /Library/Ruby/Gems/1.8/gems/taps-0.2.19/lib/taps/../../bin/../lib/taps/schema.rb:24:in `create_config'
    from /Library/Ruby/Gems/1.8/gems/taps-0.2.19/lib/taps/../../bin/../lib/taps/schema.rb:36:in `connection'
    from /Library/Ruby/Gems/1.8/gems/taps-0.2.19/lib/taps/../../bin/../lib/taps/schema.rb:43:in `dump'
    from /Library/Ruby/Gems/1.8/gems/taps-0.2.19/lib/taps/../../bin/../lib/taps/schema.rb:62:in `indexes'
    from /Library/Ruby/Gems/1.8/gems/taps-0.2.19/lib/taps/../../bin/schema:26
Resetting sequences

이것을 일으키는 원인과 어떻게 고칠 수 있는지 아십니까?

도움이 되었습니까?

해결책

Heroku는 Schema.rb가 필요합니다. heroku db:push. 나는 a schema.rb 레일을 통해. 그것을 Heroku에 배치 한 다음 DB 푸시가 작동했습니다.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top