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

Change minimum Ruby version for Puma to 2.2 + specify rdoc version under 2.2 #2013

Merged
merged 8 commits into from
Jul 20, 2018

Conversation

benoittgt
Copy link
Member

Fix #2012

Puma now requires Ruby 2.2 minimum https://github.com/puma/puma/pull/1506/files

@benoittgt
Copy link
Member Author

The issue is now on rdoc

Using rails 4.0.13
Installing rdoc 6.0.4
Gem::RuntimeRequirementNotMetError: rdoc requires Ruby version >= 2.2.2. The
current ruby version is 2.1.0.
An error occurred while installing rdoc (6.0.4), and Bundler cannot
continue.
Make sure that `gem install rdoc -v '6.0.4' --source 'https://rubygems.org/'`

Because of ruby/rdoc@51b03c3

@benoittgt benoittgt changed the title Change minimum Ruby version for Puma to 2.2 Change minimum Ruby version for Puma to 2.2 + specify rdoc version under 2.2 Jul 15, 2018
@benoittgt
Copy link
Member Author

It doesn't seem this is the way to fix rdoc issue. https://travis-ci.org/rspec/rspec-rails/builds/404100674

Do I miss something?

@benoittgt benoittgt force-pushed the handle-puma-gemspec-ruby-2-2 branch 2 times, most recently from c809ae3 to a1d9f81 Compare July 16, 2018 18:54
@benoittgt
Copy link
Member Author

It seems to be better now. Even if it's not very stable (especially on rails 3).

Feel free to merge it if it's ok RSpec core team members.

Gemfile Outdated
# Version 6.0.4 of rdoc requires Ruby 2.2
if RUBY_VERSION < '2.2'
gem 'rdoc', '< 6.0.4'
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If rdoc is failing it's likely down in the app installs, not in our outer Gemfile, you can see in the example app generator gsub rules for generated Gemfiles which help to mitigate this.

gem 'puma', :git => 'git://github.com/puma/puma', :branch => 'master'
end
when /stable$/
gem_list = %w[rails railties actionmailer actionpack activerecord activesupport]
gem_list << 'activejob' if version > '4-1-stable'
gem_list << 'actionview' if version > '4-0-stable'
if RUBY_VERSION >= "1.9.3"
if RUBY_VERSION >= "2.2"
Copy link
Member

@JonRowe JonRowe Jul 17, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we'd normally do a gate here, install an older version of puma on platforms that support it, and install the latest on Ruby 2.2, this is necessary to support older rubies.

@@ -40,7 +40,7 @@ when nil, false, ""
else
gem "rails", version

if version >= '5-1-stable' && RUBY_VERSION >= "1.9.3"
if version >= '5-1-stable' && RUBY_VERSION >= "2.2"
Copy link
Member

@JonRowe JonRowe Jul 17, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above.

@benoittgt
Copy link
Member Author

This CI is a nightmare. I tried only on failing build on my machine and it's working. I hope I understand properly your comments @JonRowe. I will look at it tonight (UTC) again.

@@ -47,6 +47,11 @@
| gem 'mime-types', '< 3'
|end
|
|# Version 6.0.4 of rdoc requires Ruby 2.2
|if RUBY_VERSION < '2.2'
| gem 'rdoc', '< 6.0.4'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to do a gsub, to specify the version only if rails adds it, and ensures theres only one, see line 24

gem 'puma', :git => 'git://github.com/puma/puma', :branch => 'master'
end
when /stable$/
gem_list = %w[rails railties actionmailer actionpack activerecord activesupport]
gem_list << 'activejob' if version > '4-1-stable'
gem_list << 'actionview' if version > '4-0-stable'
if RUBY_VERSION >= "1.9.3"
if RUBY_VERSION >= "1.9.3" && RUBY_VERSION < "2.2"
gem "puma", "~> 3.11.4"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One of these (this line, and line 26) is wrong, but I'm not sure which, can puma ever be found in the rails repo?

@benoittgt benoittgt force-pushed the handle-puma-gemspec-ruby-2-2 branch from dc02578 to 65d85a3 Compare July 20, 2018 10:49
@benoittgt
Copy link
Member Author

I read this 087cb16 and this aa93e58 and it helps me to understand what could I do.

For me we don't need puma before Ruby 2.2. Because it seems we need puma for system test added into Rails 5.1. The minimum requirement for Rails 5.1 is Ruby 2.2 https://github.com/rails/rails/blob/5-1-stable/rails.gemspec#L10

So maybe the initial commit is not a bad idea 33e41f2

For rdoc you did the change few week ago. 6a3e2bc

So I rebase from master and keep only my initial commit. We will see what CI say.

@JonRowe
Copy link
Member

JonRowe commented Jul 20, 2018

Actually even Rails 5 requires >= Ruby 2.2 so this should be safe

@JonRowe
Copy link
Member

JonRowe commented Jul 20, 2018

If this goes green merge it @benoittgt, sorry for the wild goose chase!

@benoittgt
Copy link
Member Author

The error is now somewhere else

bundle exec rails new ./tmp/example_app --no-rc --skip-javascript --skip-sprockets --skip-git --skip-test-unit --skip-listen --skip-bundle --template=example_app_generator/generate_app.rb
Traceback (most recent call last):
	3: from /home/travis/.rvm/gems/ruby-2.5.1/bin/ruby_executable_hooks:24:in `<main>'
	2: from /home/travis/.rvm/gems/ruby-2.5.1/bin/ruby_executable_hooks:24:in `eval'
	1: from /home/travis/.rvm/gems/ruby-2.5.1/bin/bundle:23:in `<main>'
/home/travis/.rvm/gems/ruby-2.5.1/bin/bundle:23:in `load': cannot load such file -- /home/travis/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.3/exe/bundle (LoadError)
rake aborted!
Command failed with status (1): [bundle exec rails new ./tmp/example_app --...]
/home/travis/build/rspec/bundle/ruby/2.5.0/gems/rake-12.3.1/lib/rake/file_utils.rb:67:in `block in create_shell_runner'
/home/travis/build/rspec/bundle/ruby/2.5.0/gems/rake-12.3.1/lib/rake/file_utils.rb:57:in `sh'
/home/travis/build/rspec/rspec-rails/Rakefile:63:in `block (2 levels) in <top (required)>'

I'm gonna take a look

@benoittgt
Copy link
Member Author

Ok. This seems linked rubygems/bundler#6629

See: rubygems/bundler#6629
Should be changed when fixed on next bundler release
@benoittgt benoittgt merged commit 814b377 into rspec:master Jul 20, 2018
@benoittgt benoittgt deleted the handle-puma-gemspec-ruby-2-2 branch July 20, 2018 12:07
@benoittgt
Copy link
Member Author

I will monitor the status of this issue on bundler and will remove the specific version of bundler when it will be fixed.

benoittgt added a commit to benoittgt/rspec-rails that referenced this pull request Sep 19, 2018
On bundle 1.16.3 we start seeing fail builds:
- rspec#2013 (comment)

This is related to:
- rspec#2013 (comment)

As mentionned this has been fixed in 1.16.4:
- rubygems/bundler#6629 (comment)
benoittgt added a commit to benoittgt/rspec-rails that referenced this pull request Sep 19, 2018
On bundle 1.16.3 we start seeing fail builds:
- rspec#2013 (comment)

This is related to:
- rspec#2013 (comment)

As mentionned this has been fixed in 1.16.4:
- rubygems/bundler#6629 (comment)
benoittgt added a commit to benoittgt/rspec-rails that referenced this pull request Sep 20, 2018
On bundle 1.16.3 we start seeing fail builds:
- rspec#2013 (comment)

This is related to:
- rspec#2013 (comment)

As mentionned this has been fixed in 1.16.4:
- rubygems/bundler#6629 (comment)
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 this pull request may close these issues.

2 participants