rubyonjets / jets

Ruby on Jets
http://rubyonjets.com
MIT License
2.6k stars 181 forks source link

Deploys unnused gems #406

Closed KevinColemanInc closed 3 months ago

KevinColemanInc commented 4 years ago

Checklist

My Environment

Software Version
Operating System OSX
Jets 2.3.5
Ruby 2.5.7

Expected Behaviour

When a gem is removed from the Gemfile or Gemfile.lock, it is not deployed.

Current Behavior

When a gem is removed from the Gemfile or Gemfile.lock, it remains in your gems directory and is still deployed.

Step-by-step reproduction instructions

  1. Add a very large gem to your Gemfile (like bootstrap-sass)
  2. bundle install
  3. Deploy the app
  4. Remove the gem from your Gemfile
  5. bundle install
  6. Deploy the app
  7. Notice how the the gems directory (open /tmp/jets/{project_name}/stage/code/vendor/gems/ruby/2.5.0/) still has the gem inside it.
  8. If your lambda package is too large, then it rejects the deploy.

Solution Suggestion

  1. Quick and easy: Offer a "clean" command to clear out the cache
  2. If your Gemfile.lock file changes since the last deploy, clean the gem cache
  3. Only remove the gems that are not inside your Gemfile.lock
tongueroo commented 3 months ago

Jets 6.0 uses Docker to build dependencies upon deployment. It's customizable.