title: How to install gems via git in Docker container?
body: <p>I try to develop rails app on docker.</p>
  
  <p><code>docker-compose build</code> is succeed, but the error occured in <code>docker-compose up</code>.</p>
  
  <p>In Gemfile, I use rails with github like below.
  <code>gem 'rails', github: 'rails/rails'</code></p>
  
  <p>This cause error in docker-compose up like this</p>
  
  <pre><code>web_1  | /usr/local/lib/ruby/site_ruby/2.5.0/rubygems/dependency.rb:310:in `to_specs': Could not find 'activesupport' (&gt;= 4.2) among 110 total gem(s) (Gem::MissingSpecError)
  web_1  | Checked in 'GEM_PATH=/usr/local/bundle:/root/.gem/ruby/2.5.0:/usr/local/lib/ruby/gems/2.5.0', execute `gem env` for more information
  web_1  |    from /usr/local/lib/ruby/site_ruby/2.5.0/rubygems/specification.rb:1464:in `block in activate_dependencies'
  web_1  |    from /usr/local/lib/ruby/site_ruby/2.5.0/rubygems/specification.rb:1453:in `each'
  web_1  |    from /usr/local/lib/ruby/site_ruby/2.5.0/rubygems/specification.rb:1453:in `activate_dependencies'
  web_1  |    from /usr/local/lib/ruby/site_ruby/2.5.0/rubygems/specification.rb:1435:in `activate'
  web_1  |    from /usr/local/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_gem.rb:68:in `block in gem'
  web_1  |    from /usr/local/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_gem.rb:67:in `synchronize'
  web_1  |    from /usr/local/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_gem.rb:67:in `gem'
  web_1  |    from /hateblocker/bin/spring:14:in `&lt;top (required)&gt;'
  web_1  |    from bin/rails:3:in `load'
  web_1  |    from bin/rails:3:in `&lt;main&gt;'
  hateblocker_web_1 exited with code 1
  </code></pre>
  
  <p>When I edited Gemfile like below, no error occured.</p>
  
  <p><code>gem 'rails'</code></p>
  
  <p>From error message I found that installing some gems via git failed in container.
  Maybe this cause this error.</p>
  
  <p>Is there any way to install gems via git in container?</p>
  
  <p>Dockerfile and docker-compose.yml is <a href="https://github.com/colorbox/hateblocker/tree/dockerize" rel="nofollow noreferrer">here</a>.</p>