Ruby: スクレイピングしたデータをHerokuへアップロード出来ない

#目的
rubyの勉強という意味も込めてスクレイピングソフトを作りherokuにアップロードするところまでをやってみる。

#問題
`git heroku push master`時に以下のエラーが表示される。

```
Counting objects: 131, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (123/123), done.
Writing objects: 100% (131/131), 30.43 KiB | 0 bytes/s, done.
Total 131 (delta 28), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.2.4
remote: -----> Installing dependencies using bundler 1.11.2
remote:        Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
remote:        Fetching source index from https://rubygems.org/
remote:        Installing i18n 0.7.0
remote:        Installing rake 11.3.0
remote:        Installing json 1.8.3 with native extensions
remote:        Installing thread_safe 0.3.5
remote:        Installing builder 3.2.2
remote:        Installing minitest 5.9.1
remote:        Installing erubis 2.7.0
remote:        Installing mini_portile2 2.1.0
remote:        Installing rack 1.6.4
remote:        Installing pkg-config 1.1.7
remote:        Installing arel 6.0.3
remote:        Installing coffee-script-source 1.10.0
remote:        Installing execjs 2.7.0
remote:        Installing thor 0.19.1
remote:        Installing concurrent-ruby 1.0.2
remote:        Installing multi_json 1.12.1
remote:        Installing pg 0.19.0 with native extensions
remote:        Installing mime-types-data 3.2016.0521
remote:        Using bundler 1.11.2
remote:        Installing rails_serve_static_assets 0.0.5
remote:        Installing rails_stdout_logging 0.0.5
remote:        Installing sass 3.4.22
remote:        Installing tilt 2.0.5
remote:        Installing turbolinks-source 5.0.0
remote:        Installing tzinfo 1.2.2
remote:        Installing nokogiri 1.6.8 with native extensions
remote:        Installing rack-test 0.6.3
remote:        Installing coffee-script 2.4.1
remote:        Installing uglifier 3.0.2
remote:        Installing sprockets 3.7.0
remote:        Installing mime-types 3.1
remote:        Installing turbolinks 5.0.1
remote:        Installing rails_12factor 0.0.3
remote:        Installing activesupport 4.2.2
remote:        Installing mail 2.6.4
remote:        Installing rdoc 4.2.2
remote:        Installing rails-deprecated_sanitizer 1.0.3
remote:        Installing globalid 0.3.7
remote:        Installing jbuilder 2.6.0
remote:        Installing activemodel 4.2.2
remote:        Installing sdoc 0.4.1
remote:        Installing activejob 4.2.2
remote:        Installing activerecord 4.2.2
remote:        Installing rails-dom-testing 1.0.7
remote:        Installing loofah 2.0.3
remote:        Installing rails-html-sanitizer 1.0.3
remote:        Installing actionview 4.2.2
remote:        Installing actionpack 4.2.2
remote:        Installing sprockets-rails 3.2.0
remote:        Installing actionmailer 4.2.2
remote:        Installing railties 4.2.2
remote:        Installing coffee-rails 4.1.1
remote:        Installing sass-rails 5.0.6
remote:        Installing jquery-rails 4.2.1
remote:        Installing rails 4.2.2
remote:        Bundle complete! 15 Gemfile dependencies, 55 gems now installed.
remote:        Gems in the groups development and test were not installed.
remote:        Bundled gems are installed into ./vendor/bundle.
remote:        Post-install message from rdoc:
remote:        Depending on your version of ruby, you may need to install ruby rdoc/ri data:
remote:        <= 1.8.6 : unsupported
remote:        = 1.8.7 : gem install rdoc-data; rdoc-data --install
remote:        = 1.9.1 : gem install rdoc-data; rdoc-data --install
remote:        >= 1.9.2 : nothing to do! Yay!
remote:        Bundle completed (37.40s)
remote:        Cleaning up the bundler cache.
remote: sh: 2: Syntax error: Unterminated quoted string
remote: sh: 2: Syntax error: Unterminated quoted string
remote:  !
remote:  !     Could not detect rake tasks
remote:  !     ensure you can run `$ bundle exec rake -P` against your app
remote:  !     and using the production group of your Gemfile.
remote:  !     rake aborted!
remote:  !     LoadError: cannot load such file -- sqlite3
remote:  !     /tmp/build_594efcf23294fe2b1f40ce28762fdca2/lib/tasks/scrape.rake:4:in `require
remote:  !     /tmp/build_594efcf23294fe2b1f40ce28762fdca2/lib/tasks/scrape.rake:4:in `<top (required)>'
remote:  !     /tmp/build_594efcf23294fe2b1f40ce28762fdca2/vendor/bundle/ruby/2.2.0/gems/railties-4.2.2/lib/rails/engine.rb:658:in `load'
remote:  !     /tmp/build_594efcf23294fe2b1f40ce28762fdca2/vendor/bundle/ruby/2.2.0/gems/railties-4.2.2/lib/rails/engine.rb:658:in `block in run_tasks_blocks'
remote:  !     /tmp/build_594efcf23294fe2b1f40ce28762fdca2/vendor/bundle/ruby/2.2.0/gems/railties-4.2.2/lib/rails/engine.rb:658:in `each'
remote:  !     /tmp/build_594efcf23294fe2b1f40ce28762fdca2/vendor/bundle/ruby/2.2.0/gems/railties-4.2.2/lib/rails/engine.rb:658:in `run_tasks_blocks'
remote:  !     /tmp/build_594efcf23294fe2b1f40ce28762fdca2/vendor/bundle/ruby/2.2.0/gems/railties-4.2.2/lib/rails/application.rb:452:in `run_tasks_blocks'
remote:  !     /tmp/build_594efcf23294fe2b1f40ce28762fdca2/vendor/bundle/ruby/2.2.0/gems/railties-4.2.2/lib/rails/engine.rb:453:in `load_tasks'
remote:  !     /tmp/build_594efcf23294fe2b1f40ce28762fdca2/Rakefile:6:in `<top (required)>'
remote:  !     /tmp/build_594efcf23294fe2b1f40ce28762fdca2/vendor/bundle/ruby/2.2.0/gems/rake-11.3.0/lib/rake/rake_module.rb:28:in `load'
remote:  !     /tmp/build_594efcf23294fe2b1f40ce28762fdca2/vendor/bundle/ruby/2.2.0/gems/rake-11.3.0/lib/rake/rake_module.rb:28:in `load_rakefile'
remote:  !     /tmp/build_594efcf23294fe2b1f40ce28762fdca2/vendor/bundle/ruby/2.2.0/gems/rake-11.3.0/lib/rake/application.rb:686:in `raw_load_rakefile'
remote:  !     /tmp/build_594efcf23294fe2b1f40ce28762fdca2/vendor/bundle/ruby/2.2.0/gems/rake-11.3.0/lib/rake/application.rb:96:in `block in load_rakefile'
remote:  !     /tmp/build_594efcf23294fe2b1f40ce28762fdca2/vendor/bundle/ruby/2.2.0/gems/rake-11.3.0/lib/rake/application.rb:178:in `standard_exception_handling'
remote:  !     /tmp/build_594efcf23294fe2b1f40ce28762fdca2/vendor/bundle/ruby/2.2.0/gems/rake-11.3.0/lib/rake/application.rb:95:in `load_rakefile'
remote:  !     /tmp/build_594efcf23294fe2b1f40ce28762fdca2/vendor/bundle/ruby/2.2.0/gems/rake-11.3.0/lib/rake/application.rb:79:in `block in run'
remote:  !     /tmp/build_594efcf23294fe2b1f40ce28762fdca2/vendor/bundle/ruby/2.2.0/gems/rake-11.3.0/lib/rake/application.rb:178:in `standard_exception_handling'
remote:  !     /tmp/build_594efcf23294fe2b1f40ce28762fdca2/vendor/bundle/ruby/2.2.0/gems/rake-11.3.0/lib/rake/application.rb:77:in `run'
remote:  !     /tmp/build_594efcf23294fe2b1f40ce28762fdca2/vendor/bundle/ruby/2.2.0/gems/rake-11.3.0/exe/rake:27:in `<top (required)>'
remote:  !     vendor/bundle/bin/rake:16:in `load'
remote:  !     vendor/bundle/bin/rake:16:in `<main>'
remote:  !
remote: /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/helpers/rake_runner.rb:102:in `load_rake_tasks!': Could not detect rake tasks (LanguagePack::Helpers::RakeRunner::CannotLoadRakefileError)
remote: ensure you can run `$ bundle exec rake -P` against your app
remote: and using the production group of your Gemfile.
remote: rake aborted!
remote: LoadError: cannot load such file -- sqlite3
remote: /tmp/build_594efcf23294fe2b1f40ce28762fdca2/lib/tasks/scrape.rake:4:in `require'
remote: /tmp/build_594efcf23294fe2b1f40ce28762fdca2/lib/tasks/scrape.rake:4:in `<top (required)>'
remote: /tmp/build_594efcf23294fe2b1f40ce28762fdca2/vendor/bundle/ruby/2.2.0/gems/railties-4.2.2/lib/rails/engine.rb:658:in `load'
remote: /tmp/build_594efcf23294fe2b1f40ce28762fdca2/vendor/bundle/ruby/2.2.0/gems/railties-4.2.2/lib/rails/engine.rb:658:in `block in run_tasks_blocks'
remote: /tmp/build_594efcf23294fe2b1f40ce28762fdca2/vendor/bundle/ruby/2.2.0/gems/railties-4.2.2/lib/rails/engine.rb:658:in `each'
remote: /tmp/build_594efcf23294fe2b1f40ce28762fdca2/vendor/bundle/ruby/2.2.0/gems/railties-4.2.2/lib/rails/engine.rb:658:in `run_tasks_blocks'
remote: /tmp/build_594efcf23294fe2b1f40ce28762fdca2/vendor/bundle/ruby/2.2.0/gems/railties-4.2.2/lib/rails/application.rb:452:in `run_tasks_blocks'
remote: /tmp/build_594efcf23294fe2b1f40ce28762fdca2/vendor/bundle/ruby/2.2.0/gems/railties-4.2.2/lib/rails/engine.rb:453:in `load_tasks'
remote: /tmp/build_594efcf23294fe2b1f40ce28762fdca2/Rakefile:6:in `<top (required)>'
remote: /tmp/build_594efcf23294fe2b1f40ce28762fdca2/vendor/bundle/ruby/2.2.0/gems/rake-11.3.0/lib/rake/rake_module.rb:28:in `load'
remote: /tmp/build_594efcf23294fe2b1f40ce28762fdca2/vendor/bundle/ruby/2.2.0/gems/rake-11.3.0/lib/rake/rake_module.rb:28:in `load_rakefile'
remote: /tmp/build_594efcf23294fe2b1f40ce28762fdca2/vendor/bundle/ruby/2.2.0/gems/rake-11.3.0/lib/rake/application.rb:686:in `raw_load_rakefile'
remote: /tmp/build_594efcf23294fe2b1f40ce28762fdca2/vendor/bundle/ruby/2.2.0/gems/rake-11.3.0/lib/rake/application.rb:96:in `block in load_rakefile'
remote: /tmp/build_594efcf23294fe2b1f40ce28762fdca2/vendor/bundle/ruby/2.2.0/gems/rake-11.3.0/lib/rake/application.rb:178:in `standard_exception_handling'
remote: /tmp/build_594efcf23294fe2b1f40ce28762fdca2/vendor/bundle/ruby/2.2.0/gems/rake-11.3.0/lib/rake/application.rb:95:in `load_rakefile'
remote: /tmp/build_594efcf23294fe2b1f40ce28762fdca2/vendor/bundle/ruby/2.2.0/gems/rake-11.3.0/lib/rake/application.rb:79:in `block in run'
remote: /tmp/build_594efcf23294fe2b1f40ce28762fdca2/vendor/bundle/ruby/2.2.0/gems/rake-11.3.0/lib/rake/application.rb:178:in `standard_exception_handling'
remote: /tmp/build_594efcf23294fe2b1f40ce28762fdca2/vendor/bundle/ruby/2.2.0/gems/rake-11.3.0/lib/rake/application.rb:77:in `run'
remote: /tmp/build_594efcf23294fe2b1f40ce28762fdca2/vendor/bundle/ruby/2.2.0/gems/rake-11.3.0/exe/rake:27:in `<top (required)>'
remote: vendor/bundle/bin/rake:16:in `load'
remote: vendor/bundle/bin/rake:16:in `<main>'
remote: 	from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/ruby.rb:746:in `rake'
remote: 	from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/rails4.rb:77:in `block (2 levels) in run_assets_precompile_rake_task'
remote: 	from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/base.rb:131:in `log'
remote: 	from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/rails4.rb:71:in `block in run_assets_precompile_rake_task'
remote: 	from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/instrument.rb:18:in `block (2 levels) in instrument'
remote: 	from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/instrument.rb:40:in `yield_with_block_depth'
remote: 	from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/instrument.rb:17:in `block in instrument'
remote: 	from /app/vendor/ruby-2.3.1/lib/ruby/2.3.0/benchmark.rb:308:in `realtime'
remote: 	from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/instrument.rb:16:in `instrument'
remote: 	from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/base.rb:48:in `instrument'
remote: 	from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/base.rb:44:in `instrument'
remote: 	from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/rails4.rb:70:in `run_assets_precompile_rake_task'
remote: 	from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/ruby.rb:104:in `block (2 levels) in compile'
remote: 	from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/ruby.rb:767:in `allow_git'
remote: 	from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/ruby.rb:98:in `block in compile'
remote: 	from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/instrument.rb:18:in `block (2 levels) in instrument'
remote: 	from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/instrument.rb:40:in `yield_with_block_depth'
remote: 	from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/instrument.rb:17:in `block in instrument'
remote: 	from /app/vendor/ruby-2.3.1/lib/ruby/2.3.0/benchmark.rb:308:in `realtime'
remote: 	from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/instrument.rb:16:in `instrument'
remote: 	from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/base.rb:48:in `instrument'
remote: 	from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/base.rb:44:in `instrument'
remote: 	from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/ruby.rb:88:in `compile'
remote: 	from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/rails2.rb:49:in `block in compile'
remote: 	from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/instrument.rb:18:in `block (2 levels) in instrument'
remote: 	from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/instrument.rb:40:in `yield_with_block_depth'
remote: 	from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/instrument.rb:17:in `block in instrument'
remote: 	from /app/vendor/ruby-2.3.1/lib/ruby/2.3.0/benchmark.rb:308:in `realtime'
remote: 	from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/instrument.rb:16:in `instrument'
remote: 	from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/base.rb:48:in `instrument'
remote: 	from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/base.rb:44:in `instrument'
remote: 	from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/rails2.rb:47:in `compile'
remote: 	from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/rails3.rb:38:in `block in compile'
remote: 	from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/instrument.rb:18:in `block (2 levels) in instrument'
remote: 	from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/instrument.rb:40:in `yield_with_block_depth'
remote: 	from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/instrument.rb:17:in `block in instrument'
remote: 	from /app/vendor/ruby-2.3.1/lib/ruby/2.3.0/benchmark.rb:308:in `realtime'
remote: 	from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/instrument.rb:16:in `instrument'
remote: 	from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/base.rb:48:in `instrument'
remote: 	from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/base.rb:44:in `instrument'
remote: 	from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/rails3.rb:37:in `compile'
remote: 	from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/rails4.rb:41:in `block in compile'
remote: 	from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/instrument.rb:18:in `block (2 levels) in instrument'
remote: 	from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/instrument.rb:40:in `yield_with_block_depth'
remote: 	from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/instrument.rb:17:in `block in instrument'
remote: 	from /app/vendor/ruby-2.3.1/lib/ruby/2.3.0/benchmark.rb:308:in `realtime'
remote: 	from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/instrument.rb:16:in `instrument'
remote: 	from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/base.rb:48:in `instrument'
remote: 	from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/base.rb:44:in `instrument'
remote: 	from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/rails4.rb:40:in `compile'
remote: 	from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/bin/compile:16:in `block (2 levels) in <main>'
remote: 	from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/base.rb:131:in `log'
remote: 	from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/bin/compile:15:in `block in <main>'
remote: 	from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/instrument.rb:35:in `block in trace'
remote: 	from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/instrument.rb:18:in `block (2 levels) in instrument'
remote: 	from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/instrument.rb:40:in `yield_with_block_depth'
remote: 	from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/instrument.rb:17:in `block in instrument'
remote: 	from /app/vendor/ruby-2.3.1/lib/ruby/2.3.0/benchmark.rb:308:in `realtime'
remote: 	from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/instrument.rb:16:in `instrument'
remote: 	from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/instrument.rb:35:in `trace'
remote: 	from /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/bin/compile:11:in `<main>'
remote:  !     Push rejected, failed to compile Ruby app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !	Push rejected to young-thicket-78003.
remote: 
To https://git.heroku.com/young-thicket-78003.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/young-thicket-78003.git'
```

#動作環境とファイル

```
$ruby -c Gemfile
Syntax OK
```

```
heroku config
=== young-thicket-78003 Config Vars
```

```ruby:Gemfile
source 'https://rubygems.org'


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.2'
# Use sqlite3 as the database for Active Record
group :development do
	gem 'sqlite3'
end
group :production do
	gem 'pg'
	gem 'rails_12factor'
end
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc

# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use Unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

# Use Nokogiri
gem 'nokogiri'

group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug'

  # Access an IRB console on exception pages or by using <%= console %> in views
  gem 'web-console', '~> 2.0'

  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring'
end

```

```ruby:Gemfile.lock
GEM
  remote: https://rubygems.org/
  specs:
    actionmailer (4.2.2)
      actionpack (= 4.2.2)
      actionview (= 4.2.2)
      activejob (= 4.2.2)
      mail (~> 2.5, >= 2.5.4)
      rails-dom-testing (~> 1.0, >= 1.0.5)
    actionpack (4.2.2)
      actionview (= 4.2.2)
      activesupport (= 4.2.2)
      rack (~> 1.6)
      rack-test (~> 0.6.2)
      rails-dom-testing (~> 1.0, >= 1.0.5)
      rails-html-sanitizer (~> 1.0, >= 1.0.1)
    actionview (4.2.2)
      activesupport (= 4.2.2)
      builder (~> 3.1)
      erubis (~> 2.7.0)
      rails-dom-testing (~> 1.0, >= 1.0.5)
      rails-html-sanitizer (~> 1.0, >= 1.0.1)
    activejob (4.2.2)
      activesupport (= 4.2.2)
      globalid (>= 0.3.0)
    activemodel (4.2.2)
      activesupport (= 4.2.2)
      builder (~> 3.1)
    activerecord (4.2.2)
      activemodel (= 4.2.2)
      activesupport (= 4.2.2)
      arel (~> 6.0)
    activesupport (4.2.2)
      i18n (~> 0.7)
      json (~> 1.7, >= 1.7.7)
      minitest (~> 5.1)
      thread_safe (~> 0.3, >= 0.3.4)
      tzinfo (~> 1.1)
    arel (6.0.3)
    binding_of_caller (0.7.2)
      debug_inspector (>= 0.0.1)
    builder (3.2.2)
    byebug (9.0.6)
    coffee-rails (4.1.1)
      coffee-script (>= 2.2.0)
      railties (>= 4.0.0, < 5.1.x)
    coffee-script (2.4.1)
      coffee-script-source
      execjs
    coffee-script-source (1.10.0)
    concurrent-ruby (1.0.2)
    debug_inspector (0.0.2)
    erubis (2.7.0)
    execjs (2.7.0)
    globalid (0.3.7)
      activesupport (>= 4.1.0)
    i18n (0.7.0)
    jbuilder (2.6.0)
      activesupport (>= 3.0.0, < 5.1)
      multi_json (~> 1.2)
    jquery-rails (4.2.1)
      rails-dom-testing (>= 1, < 3)
      railties (>= 4.2.0)
      thor (>= 0.14, < 2.0)
    json (1.8.3)
    loofah (2.0.3)
      nokogiri (>= 1.5.9)
    mail (2.6.4)
      mime-types (>= 1.16, < 4)
    mime-types (3.1)
      mime-types-data (~> 3.2015)
    mime-types-data (3.2016.0521)
    mini_portile2 (2.1.0)
    minitest (5.9.1)
    multi_json (1.12.1)
    nokogiri (1.6.8)
      mini_portile2 (~> 2.1.0)
      pkg-config (~> 1.1.7)
    pg (0.19.0)
    pkg-config (1.1.7)
    rack (1.6.4)
    rack-test (0.6.3)
      rack (>= 1.0)
    rails (4.2.2)
      actionmailer (= 4.2.2)
      actionpack (= 4.2.2)
      actionview (= 4.2.2)
      activejob (= 4.2.2)
      activemodel (= 4.2.2)
      activerecord (= 4.2.2)
      activesupport (= 4.2.2)
      bundler (>= 1.3.0, < 2.0)
      railties (= 4.2.2)
      sprockets-rails
    rails-deprecated_sanitizer (1.0.3)
      activesupport (>= 4.2.0.alpha)
    rails-dom-testing (1.0.7)
      activesupport (>= 4.2.0.beta, < 5.0)
      nokogiri (~> 1.6.0)
      rails-deprecated_sanitizer (>= 1.0.1)
    rails-html-sanitizer (1.0.3)
      loofah (~> 2.0)
    rails_12factor (0.0.3)
      rails_serve_static_assets
      rails_stdout_logging
    rails_serve_static_assets (0.0.5)
    rails_stdout_logging (0.0.5)
    railties (4.2.2)
      actionpack (= 4.2.2)
      activesupport (= 4.2.2)
      rake (>= 0.8.7)
      thor (>= 0.18.1, < 2.0)
    rake (11.3.0)
    rdoc (4.2.2)
      json (~> 1.4)
    sass (3.4.22)
    sass-rails (5.0.6)
      railties (>= 4.0.0, < 6)
      sass (~> 3.1)
      sprockets (>= 2.8, < 4.0)
      sprockets-rails (>= 2.0, < 4.0)
      tilt (>= 1.1, < 3)
    sdoc (0.4.1)
      json (~> 1.7, >= 1.7.7)
      rdoc (~> 4.0)
    spring (2.0.0)
      activesupport (>= 4.2)
    sprockets (3.7.0)
      concurrent-ruby (~> 1.0)
      rack (> 1, < 3)
    sprockets-rails (3.2.0)
      actionpack (>= 4.0)
      activesupport (>= 4.0)
      sprockets (>= 3.0.0)
    sqlite3 (1.3.11)
    thor (0.19.1)
    thread_safe (0.3.5)
    tilt (2.0.5)
    turbolinks (5.0.1)
      turbolinks-source (~> 5)
    turbolinks-source (5.0.0)
    tzinfo (1.2.2)
      thread_safe (~> 0.1)
    uglifier (3.0.2)
      execjs (>= 0.3.0, < 3)
    web-console (2.3.0)
      activemodel (>= 4.0)
      binding_of_caller (>= 0.7.2)
      railties (>= 4.0)
      sprockets-rails (>= 2.0, < 4.0)

PLATFORMS
  ruby

DEPENDENCIES
  byebug
  coffee-rails (~> 4.1.0)
  jbuilder (~> 2.0)
  jquery-rails
  nokogiri
  pg
  rails (= 4.2.2)
  rails_12factor
  sass-rails (~> 5.0)
  sdoc (~> 0.4.0)
  spring
  sqlite3
  turbolinks
  uglifier (>= 1.3.0)
  web-console (~> 2.0)

BUNDLED WITH
   1.10.4

```

```ruby:scrape.rake

 require 'open-uri'
 require 'nokogiri'
# require 'sqlite3'

 namespace :scrape do
	desc "edmサイトからタイトルを取得"
	task :scrape => :environment do

	url = "https://disc-j.net/"
	charset = nil
	page = nil
	count = 0
	(1..41).each do |count|
		url = "https://disc-j.net/page/#{count}/"
		html = open(url) do |f|
		  charset = f.charset
		  f.read
		end

		doc = Nokogiri::HTML.parse(html, nil, charset)

		els = doc.css("#newEntry")
		el_lst = els.css("li")
		data = []
		el_lst.each do |entry|
		  name = entry.css("h2")[0]
		  name_content = name.content
		  url = entry.css("a")[0][:href]
		  data << url
		#puts doc.css('div.text.bold > h2').text
		product = Product.create(
			name: name_content,
			url: url
		
		)
	
   	end
    end
end
end


```


#考察
`Syntax error: Unterminated quoted string`が引っかかる。`rake aborted!`の下を見てみると`LoadError: cannot load such file -- sqlite3`と書いてある。その下には`/tmp/build_e42bd84be8d68d811a4c01cda08e7866/lib/tasks/scrape.rake:4:in `require'`と書いてあるので恐らく`scrape.rake`のスクリプト内にある`require sqlite3`というコマンドがエラーを引き起こしている原因なのでは？という結論に至る。

#試してみたこと

- `bundle install --without production`
`pg gem`がある`group :production do`を飛ばして必要なgemをインストール（効果なし）

```
Using rake 11.3.0
Using i18n 0.7.0
Using json 1.8.3
Using minitest 5.9.1
Using thread_safe 0.3.5
Using tzinfo 1.2.2
Using activesupport 4.2.2
Using builder 3.2.2
Using erubis 2.7.0
Using mini_portile2 2.1.0
Using pkg-config 1.1.7
Using nokogiri 1.6.8
Using rails-deprecated_sanitizer 1.0.3
Using rails-dom-testing 1.0.7
Using loofah 2.0.3
Using rails-html-sanitizer 1.0.3
Using actionview 4.2.2
Using rack 1.6.4
Using rack-test 0.6.3
Using actionpack 4.2.2
Using globalid 0.3.7
Using activejob 4.2.2
Using mime-types-data 3.2016.0521
Using mime-types 3.1
Using mail 2.6.4
Using actionmailer 4.2.2
Using activemodel 4.2.2
Using arel 6.0.3
Using activerecord 4.2.2
Using debug_inspector 0.0.2
Using binding_of_caller 0.7.2
Using byebug 9.0.6
Using coffee-script-source 1.10.0
Using execjs 2.7.0
Using coffee-script 2.4.1
Using thor 0.19.1
Using railties 4.2.2
Using coffee-rails 4.1.1
Using concurrent-ruby 1.0.2
Using multi_json 1.12.1
Using jbuilder 2.6.0
Using jquery-rails 4.2.1
Using bundler 1.10.4
Using sprockets 3.7.0
Using sprockets-rails 3.2.0
Using rails 4.2.2
Using rdoc 4.2.2
Using sass 3.4.22
Using tilt 2.0.5
Using sass-rails 5.0.6
Using sdoc 0.4.1
Using spring 2.0.0
Using sqlite3 1.3.11
Using turbolinks-source 5.0.0
Using turbolinks 5.0.1
Using uglifier 3.0.2
Using web-console 2.3.0
Bundle complete! 15 Gemfile dependencies, 57 gems now installed.
Gems in the group production were not installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
```

- インストールと再インストール（効果なし）

```
$ bundle exec gem uninstall pg

$ bundle install --without production

$ bundle exec gem uninstall rails_12factor

$ bundle install --without production
```

- `bundle update sass-rails`で再度sassを最新版に更新（効果なし）

- `scrape.rake`のスクリプト内にある`require sqlite3`をコメントアウト（解決）

#思ったこと、反省、書かなかったことなど

エラーをもっと慎重に読む。何が問題で原因は何かを意識して読むと、プログラムが何の処理を行っている最中に何が原因でどういったエラーが起きているかが自ずと分かってくる。その問題の根源はスクリプトのエラーなのかシステム上のエラーなのかetcでググる質も変わってくる。

直接的な解決にはつながらないかもしれないが`git remote -v`で状況確認することは意外と大切。（上記に書いたエラーの前に間違えてappを消してしまった際に起こったエラーの対処は）それがきっかけで`git remote rm heroku
git remote add heroku git@heroku.com:xxxxx.git`を知り結果的にエラー解決につながった。

#参考にしたリンク
- [Heroku deployment fails during Bundle Install](http://stackoverflow.com/questions/22017128/heroku-deployment-fails-during-bundle-install)
- [Error pushing to Heroku with Rails - sh: 2: Syntax error: Unterminated quoted string](http://stackoverflow.com/questions/38339093/error-pushing-to-heroku-with-rails-sh-2-syntax-error-unterminated-quoted-st)
- [Error while pushing Rails app to Heroku](http://stackoverflow.com/questions/36327778/error-while-pushing-rails-app-to-heroku)
- [Pushing app to heroku problem](http://stackoverflow.com/questions/2947190/pushing-app-to-heroku-problem)
- [heroku push rejected, failed to compile Ruby/rails app](http://stackoverflow.com/questions/15737296/heroku-push-rejected-failed-to-compile-ruby-rails-app)

##間違えてheroku appを消してしまったときの対処
- [Can't push to heroku after accidentally deleting app on heroku](http://stackoverflow.com/questions/28749771/cant-push-to-heroku-after-accidentally-deleting-app-on-heroku)

##Herokuへのアップロード関する記事

- [Webサービスをすぐに動かせる！HerokuでRailsアプリを公開する方法【初心者向け】](http://techacademy.jp/magazine/6401)
- [Rails X Herokuでアプリを作成 [完全初心者向けチュートリアル]](http://morizyun.github.io/blog/beginner-rails-heroku-tutorial/#7)
- [HerokuでDBのデータをダウンロードしたりアップロードしたり](http://blog.ruedap.com/2011/02/22/ruby-heroku-database-sqlite3-download-upload)