Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ruby version issues #50

Closed
maths22 opened this issue Jun 7, 2022 · 3 comments · Fixed by #55
Closed

Ruby version issues #50

maths22 opened this issue Jun 7, 2022 · 3 comments · Fixed by #55

Comments

@maths22
Copy link

maths22 commented Jun 7, 2022

We have the following in our Gemfile:

ruby ">= 2.7.0", "< 3.1"

When running with bootboot on ruby 2.7.6, we get the following error:

Could not find gem 'Ruby (= 2.7.6)' in Bootboot plugin Ruby source.

The source contains the following gems matching 'Ruby':
  * Ruby-2.7.0
@rafaelfranca
Copy link
Member

Thank you for the issue. The problem is probably in this file and how we try to detect the ruby version. Do you want to take a look on how to fix it?

ashkulz added a commit to teamsimplepay/bootboot that referenced this issue Jan 16, 2023
ashkulz added a commit to teamsimplepay/bootboot that referenced this issue Jan 16, 2023
ashkulz added a commit to teamsimplepay/bootboot that referenced this issue Jan 24, 2023
ashkulz added a commit to teamsimplepay/bootboot that referenced this issue Jan 25, 2023
nvasilevski pushed a commit that referenced this issue Jan 25, 2023
* add test which reproduces #50

* fix issue during "bundle install" with non-exact Ruby versions

* only override version when dual-booting Ruby if exact version specified

* update CHANGELOG.md
@adamstegman
Copy link

adamstegman commented Feb 17, 2023

@maths22 did #55 solve your issue? I ask because a couple folks on our team are still running into this error, even on v0.2.2.

Updating the .../Gemfile_next.lock
Fetching gem metadata from https: //rubygems.org/.......
Could not find gem 'Ruby (= 2.7.7)' in Bootboot plugin Ruby source.

The source contains the following gems matching 'Ruby':
  * Ruby-3.0.5

@Skipants
Copy link

Skipants commented Mar 1, 2023

I see it as well.

Our Gemfile has the following:

plugin('bootboot', '~> 0.2')
Plugin.send(:load_plugin, 'bootboot') if Plugin.installed?('bootboot')

# Rails
if %w[1 true].include?(ENV['DEPENDENCIES_NEXT'])
  enable_dual_booting if Plugin.installed?('bootboot')
  ruby('3.2.1')
  gem 'rails', '~> 7.0.4'
else
  ruby('3.1.3')
  gem 'rails', '~> 6.1.6'
end

When I run bundle the first time around on Ruby 3.1.3 I get the error:

Could not find gem 'Ruby (= 3.1.3)' in Bootboot plugin Ruby source.

The source contains the following gems matching 'Ruby':
  * Ruby-3.2.1

On the second pass there's no error but Gemfile_next.lock is not updated. I have to manually change ruby to ruby-3.2.1 and do DEPENDENCIES_NEXT=1 bundle

Here's my bundler env:

Bundler       2.3.26
  Platforms   ruby, arm64-darwin-21
Ruby          3.1.3p185 (2022-11-24 revision 1a6b16756e0ba6b95ab71a441357ed5484e33498) [arm64-darwin-21]
  Full Path   /Users/andrewszczepanski/.rbenv/versions/3.1.3/bin/ruby
  Config Dir  /Users/andrewszczepanski/.rbenv/versions/3.1.3/etc
RubyGems      3.3.26
  Gem Home    /Users/andrewszczepanski/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0
  Gem Path    /Users/andrewszczepanski/.gem/ruby/3.1.0:/Users/andrewszczepanski/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0
  User Home   /Users/andrewszczepanski
  User Path   /Users/andrewszczepanski/.gem/ruby/3.1.0
  Bin Dir     /Users/andrewszczepanski/.rbenv/versions/3.1.3/bin
Tools
  Git         2.38.1
  RVM         not installed
  rbenv       rbenv 1.2.0
  chruby      not installed

I tried to clone bootboot and use the plugin locally so I could catch this and reproduce, but no luck there. Maybe something with bundler caching something? That's my best guess right now. Going to continue trying locally and see if I can isolate it when I get a chance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants