Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Bundler crashes when force_ruby_platform is set to true #5344

Closed
larskanis opened this issue Jan 21, 2017 · 4 comments · Fixed by #5345
Closed

Bundler crashes when force_ruby_platform is set to true #5344

larskanis opened this issue Jan 21, 2017 · 4 comments · Fixed by #5345
Assignees
Milestone

Comments

@larskanis
Copy link
Contributor

This is in response to #5337 .

Error Report

Questions

Please fill out answers to these questions, it'll help us figure out
why things are going wrong.

  • What did you do?

    I ran the command

C:\Users\lars\railstest>bundle config force_ruby_platform true
C:\Users\lars\railstest>bundle

Backtrace

NoMethodError: undefined method `os' for "ruby":String
  C:/Ruby24/lib/ruby/gems/2.4.0/gems/bundler-1.14.0/lib/bundler/current_ruby.rb:65:in `mingw?'
  C:/Ruby24/lib/ruby/gems/2.4.0/gems/bundler-1.14.0/lib/bundler/dependency.rb:123:in `block in current_platform?'
  C:/Ruby24/lib/ruby/gems/2.4.0/gems/bundler-1.14.0/lib/bundler/dependency.rb:122:in `any?'
  C:/Ruby24/lib/ruby/gems/2.4.0/gems/bundler-1.14.0/lib/bundler/dependency.rb:122:in `current_platform?'
  C:/Ruby24/lib/ruby/gems/2.4.0/gems/bundler-1.14.0/lib/bundler/dependency.rb:106:in `should_include?'
  C:/Ruby24/lib/ruby/gems/2.4.0/gems/bundler-1.14.0/lib/bundler/definition.rb:894:in `block in compute_requires'
  C:/Ruby24/lib/ruby/gems/2.4.0/gems/bundler-1.14.0/lib/bundler/definition.rb:893:in `each'
  C:/Ruby24/lib/ruby/gems/2.4.0/gems/bundler-1.14.0/lib/bundler/definition.rb:893:in `reduce'
  C:/Ruby24/lib/ruby/gems/2.4.0/gems/bundler-1.14.0/lib/bundler/definition.rb:893:in `compute_requires'
  C:/Ruby24/lib/ruby/gems/2.4.0/gems/bundler-1.14.0/lib/bundler/definition.rb:120:in `initialize'
  C:/Ruby24/lib/ruby/gems/2.4.0/gems/bundler-1.14.0/lib/bundler/dsl.rb:200:in `new'
  C:/Ruby24/lib/ruby/gems/2.4.0/gems/bundler-1.14.0/lib/bundler/dsl.rb:200:in `to_definition'
  C:/Ruby24/lib/ruby/gems/2.4.0/gems/bundler-1.14.0/lib/bundler/dsl.rb:12:in `evaluate'
  C:/Ruby24/lib/ruby/gems/2.4.0/gems/bundler-1.14.0/lib/bundler/definition.rb:33:in `build'
  C:/Ruby24/lib/ruby/gems/2.4.0/gems/bundler-1.14.0/lib/bundler.rb:128:in `definition'
  C:/Ruby24/lib/ruby/gems/2.4.0/gems/bundler-1.14.0/lib/bundler/cli/install.rb:67:in `run'
  C:/Ruby24/lib/ruby/gems/2.4.0/gems/bundler-1.14.0/lib/bundler/cli.rb:181:in `block in install'
  C:/Ruby24/lib/ruby/gems/2.4.0/gems/bundler-1.14.0/lib/bundler/settings.rb:98:in `temporary'
  C:/Ruby24/lib/ruby/gems/2.4.0/gems/bundler-1.14.0/lib/bundler/cli.rb:180:in `install'
  C:/Ruby24/lib/ruby/gems/2.4.0/gems/bundler-1.14.0/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
  C:/Ruby24/lib/ruby/gems/2.4.0/gems/bundler-1.14.0/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
  C:/Ruby24/lib/ruby/gems/2.4.0/gems/bundler-1.14.0/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'
  C:/Ruby24/lib/ruby/gems/2.4.0/gems/bundler-1.14.0/lib/bundler/cli.rb:20:in `dispatch'
  C:/Ruby24/lib/ruby/gems/2.4.0/gems/bundler-1.14.0/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'
  C:/Ruby24/lib/ruby/gems/2.4.0/gems/bundler-1.14.0/lib/bundler/cli.rb:11:in `start'
  C:/Ruby24/lib/ruby/gems/2.4.0/gems/bundler-1.14.0/exe/bundle:32:in `block in <top (required)>'
  C:/Ruby24/lib/ruby/gems/2.4.0/gems/bundler-1.14.0/lib/bundler/friendly_errors.rb:121:in `with_friendly_errors'
  C:/Ruby24/lib/ruby/gems/2.4.0/gems/bundler-1.14.0/exe/bundle:24:in `<top (required)>'
  C:/Ruby24/bin/bundle:22:in `load'
  C:/Ruby24/bin/bundle:22:in `<main>'

Environment

Bundler   1.14.0
Rubygems  2.6.8
Ruby      2.4.0p0 (2016-12-24 revision 57164) [i386-mingw32]
GEM_HOME  C:/Ruby24/lib/ruby/gems/2.4.0
GEM_PATH  C:/Ruby24/lib/ruby/gems/2.4.0;C:/Users/lars/.gem/ruby/2.4.0
Git       2.5.0.windows.1
Platform  x86-mingw32
OpenSSL   OpenSSL 1.0.2j  26 Sep 2016

Bundler settings

build.nokogiri
  Set for the current user (C:/Users/lars/.bundle/config): "--use-system-libraries --with-xml2-include=c:/msys64/mingw64/include/libxml2 --with-xslt-dir=c:/msys64/mingw64"
force_ruby_platform
  Set for the current user (C:/Users/lars/.bundle/config): "true"
@segiddins
Copy link
Member

Can you please also include your Gemfile?

@larskanis
Copy link
Contributor Author

@segiddins
Copy link
Member

#5345 should fix this!

@larskanis
Copy link
Contributor Author

Yes, #5345 fixes this issue.

@segiddins segiddins added this to the 1.14.2 milestone Jan 22, 2017
bundlerbot added a commit that referenced this issue Jan 23, 2017
[CurrentRuby] Ensure the local platform isnt ruby before checking os/cpu

Closes #5344

fixes the problem since `Bundler.local_platform` can now be `"ruby"` on Windows, instead of a full-blown `Gem::Platform` object, when `force_ruby_platform` is set
segiddins pushed a commit that referenced this issue Jan 23, 2017
[CurrentRuby] Ensure the local platform isnt ruby before checking os/cpu

Closes #5344

fixes the problem since `Bundler.local_platform` can now be `"ruby"` on Windows, instead of a full-blown `Gem::Platform` object, when `force_ruby_platform` is set

(cherry picked from commit 8eb8a5d)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants