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

next_rails doesn't seem to be compatible with Ruby < 2.5 #8

Closed
manuca opened this issue Sep 16, 2020 · 4 comments
Closed

next_rails doesn't seem to be compatible with Ruby < 2.5 #8

manuca opened this issue Sep 16, 2020 · 4 comments
Labels
question Further information is requested

Comments

@manuca
Copy link

manuca commented Sep 16, 2020

I hit this issue when running on Ruby 2.3.

/usr/local/lib/ruby/site_ruby/2.3.0/rubygems/specification.rb:2121:in `method_missing': undefined method `git_version' for #<Gem::Specification:0x005596b48c4cb8> (NoMethodError)
	from /usr/local/bundle/gems/next_rails-1.0.3/lib/next_rails/gem_info.rb:63:in `sourced_from_git?'
	from /usr/local/bundle/gems/next_rails-1.0.3/lib/next_rails/bundle_report.rb:65:in `select'
	from /usr/local/bundle/gems/next_rails-1.0.3/lib/next_rails/bundle_report.rb:65:in `outdated'
	from /usr/local/bundle/gems/next_rails-1.0.3/exe/bundle_report:50:in `block in <top (required)>'

I did some research on the support of git_version in Gem::Specification class of the Ruby Standard Library and it seems the method was introduced in Ruby 2.6.

@manuca
Copy link
Author

manuca commented Sep 16, 2020

Adding some info about what I'm investigating:

Line that raises the exception in next_rails:
https://github.com/fastruby/next_rails/blob/master/lib/next_rails/gem_info.rb#L63

#git_version is documented in Ruby 2.6.0 release:
https://docs.ruby-lang.org/en/2.6.0/Gem/Specification.html

#git_version not documented in Ruby 2.5.0 release
https://docs.ruby-lang.org/en/2.5.0/Gem/Specification.html

@etagwerker etagwerker changed the title next_rails doesn't seem to be compatible with Ruby < 2.6 next_rails doesn't seem to be compatible with Ruby < 2.5 Jan 25, 2021
@etagwerker
Copy link
Member

@manuca I just updated the title to say that it doesn't seem to be compatible with Ruby < 2.5, because I just tested one of my projects with Ruby 2.5.7 and it works fine:

➜  points git:(feature/upgrade-rails-5-2) ✗ bundle_report outdated
redcarpet 3.0.0: released over 7 years ago (latest version, 3.5.1, released about 1 month ago)
jquery-ui-rails 5.0.5: released over 5 years ago (latest version, 6.0.1, released about 4 years ago)
listen 3.1.5: released over 4 years ago (latest version, 3.4.1, released 12 days ago)
bootstrap-sass 3.3.7: released over 4 years ago (latest version, 3.4.1, released almost 2 years ago)
thor 0.19.4: released about 4 years ago (latest version, 1.1.0, released 6 days ago)
pg 0.21.0: released over 3 years ago (latest version, 1.2.3, released 10 months ago)
sass 3.4.25: released over 3 years ago (latest version, 3.7.4, released almost 2 years ago)
sprockets 3.7.2: released over 2 years ago (latest version, 4.0.2, released 8 months ago)
web-console 3.7.0: released over 2 years ago (latest version, 4.1.0, released 3 months ago)
shoulda-matchers 3.1.3: released almost 2 years ago (latest version, 4.5.1, released 4 days ago)
sass-rails 5.1.0: released over 1 year ago (latest version, 6.0.0, released over 1 year ago)
childprocess 3.0.0: released over 1 year ago (latest version, 4.0.0, released 7 months ago)
rspec-mocks 3.9.1: released about 1 year ago (latest version, 3.10.1, released 29 days ago)
rspec-rails 3.9.1: released 11 months ago (latest version, 4.0.2, released about 1 month ago)
unicode-display_width 1.7.0: released 11 months ago (latest version, 2.0.0, released 27 days ago)
puma 3.12.6: released 8 months ago (latest version, 5.1.1, released about 2 months ago)
bundler 1.17.3: released 8 months ago (latest version, 2.2.6, released 7 days ago)
railties 5.2.4.4: released 5 months ago (latest version, 6.1.1, released 19 days ago)
activesupport 5.2.4.4: released 5 months ago (latest version, 6.1.1, released 19 days ago)
actionview 5.2.4.4: released 5 months ago (latest version, 6.1.1, released 19 days ago)
actionpack 5.2.4.4: released 5 months ago (latest version, 6.1.1, released 19 days ago)
actioncable 5.2.4.4: released 5 months ago (latest version, 6.1.1, released 19 days ago)
activejob 5.2.4.4: released 5 months ago (latest version, 6.1.1, released 19 days ago)
actionmailer 5.2.4.4: released 5 months ago (latest version, 6.1.1, released 19 days ago)
activemodel 5.2.4.4: released 5 months ago (latest version, 6.1.1, released 19 days ago)
activerecord 5.2.4.4: released 5 months ago (latest version, 6.1.1, released 19 days ago)
activestorage 5.2.4.4: released 5 months ago (latest version, 6.1.1, released 19 days ago)
rails 5.2.4.4: released 5 months ago (latest version, 6.1.1, released 19 days ago)
rspec-core 3.9.3: released 4 months ago (latest version, 3.10.1, released 30 days ago)
regexp_parser 1.8.2: released 4 months ago (latest version, 2.0.3, released 29 days ago)
rspec-support 3.9.4: released 3 months ago (latest version, 3.10.1, released 30 days ago)
rspec-expectations 3.9.4: released 3 months ago (latest version, 3.10.1, released 30 days ago)
tzinfo 1.2.9: released about 1 month ago (latest version, 2.0.4, released about 1 month ago)
rubocop 1.7.0: released about 1 month ago (latest version, 1.8.1, released 15 days ago)
bourbon 5.0.0.beta.6: released 1 day ago (latest version, 7.0.0, released 11 months ago)
apparition 0.4.0: released 1 day ago (latest version, 0.6.0, released 7 months ago)

3 gems are sourced from git
36 of the 131 gems are out-of-date (27%)

➜  points git:(feature/upgrade-rails-5-2) ✗ bundle info next_rails
The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`.
  * next_rails (1.0.2)
	Summary: A toolkit to upgrade your next Rails application
	Homepage: https://github.com/fastruby/next_rails
	Path: /Users/etagwerker/.rvm/gems/ruby-2.5.7/gems/next_rails-1.0.2

➜  points git:(feature/upgrade-rails-5-2) ✗ rvm-prompt
ruby-2.5.7

Maybe my Gemfile is slightly different than yours and I didn't end up running the path that you ran? This is my Gemfile: https://github.com/fastruby/points/blob/main/Gemfile

@kindoflew kindoflew added the question Further information is requested label Sep 13, 2021
@arielj
Copy link

arielj commented Apr 13, 2022

Looks like the issue is not Ruby but Bundler.

The git_version method is not documented in Ruby 2.5 because Bundler was not part of Ruby before 2.6 and Bundler is the one adding that method.

I'm trying to find when that method was added in Bundler and it seems to be there since Bundler 1, so it has to be a really old bundler version to not have that method (which could happen for really old projects I guess).

TL;DR: I think the problem is with a minimum requirement of Bundler >= 1 and not with a Ruby version

@rishijain
Copy link
Collaborator

@arielj 's PR #54 have made next_rails compatible with ruby >= 2.

Closing this issue.

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

No branches or pull requests

5 participants