rubygemfile.lock

Running bundle or rspec adds line to Gemfile.lock


After running various commands (bundle and rspec for example) in a Ruby project, Gemfile.lock is updated and x86_64-darwin-17 is added to the PLATFORMS heading. Why is this happening? How can I prevent it?

Running gem env gives this interesting context:

○ → gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 2.7.6
  - RUBY VERSION: 2.5.1 (2018-03-29 patchlevel 57) [x86_64-darwin17]
  #...etc  
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-darwin-17

Solution

  • This was caused by global bundler config. Setting to false stopped the behavior.

    specific_platform (BUNDLE_SPECIFIC_PLATFORM): Allow bundler to resolve for the specific running platform and store it in the lockfile, instead of only using a generic platform. A specific platform is the exact platform triple reported by Gem::Platform.local, such as x86_64-darwin-16 or universal-java-1.8. On the other hand, generic platforms are those such as ruby, mswin, or java. In this example, x86_64-darwin-16 would map to ruby and universal-java-1.8 to java.