rubyconfig / config

Easiest way to add multi-environment yaml settings to Rails, Sinatra, Padrino and other Ruby projects.
Other
2.1k stars 230 forks source link

Add Rails 7.0 and 7.1 to the test matrix #344

Closed pkuczynski closed 11 months ago

sinsoku commented 11 months ago

When I tried to run on this branch, I got the following error

$ bundle exec appraisal rails-7.0 rake spec

NoMethodError: undefined method `assets' for #<Rails::Application::Configuration
  undefined method `assets' for #<Rails::Application::Configuration

This is caused by the removal of sprockets-rails from the rails gem dependencies in Rails v7.0. refs: https://github.com/rails/rails/commit/fb1ab3460a676ce7def0819c2e92289ef2dcbe3b

I was able to fix the error by adding sprockets-rails to gemfiles.

diff --git gemfiles/rails_7.0.gemfile gemfiles/rails_7.0.gemfile
index b660fa2..135ccae 100644
--- gemfiles/rails_7.0.gemfile
+++ gemfiles/rails_7.0.gemfile
@@ -8,5 +8,6 @@ gem "rails", "7.0.8"
 gem "rspec-rails", "~> 6.0.3"
 gem "sqlite3", "~> 1.6.4", platform: :ruby
 gem "psych", ">= 4"
+gem "sprockets-rails"

 gemspec path: "... /"
diff --git gemfiles/rails_7.1.gemfile gemfiles/rails_7.1.gemfile
index aa7a990..02b4824 100644
--- gemfiles/rails_7.1.gemfile
+++ gemfiles/rails_7.1.gemfile
@@ -8,5 +8,6 @@ gem "rails", "7.1.0.rc2"
 gem "rspec-rails", "~> 6.0.3"
 gem "sqlite3", "~> 1.6.6", platform: :ruby
 gem "psych", ">= 4"
+gem "sprockets-rails"

 gemspec path: ". /"
pkuczynski commented 11 months ago

That helped indeed! Thank you @sinsoku Now I only have errors in jruby and truffleruby. Any suggestions on how to fix them?

sinsoku commented 11 months ago

I'm not familiar with jruby and truffleruby, so I can't seem to help.

Since jruby and truffleruby tests are not executed in rails/rails CI, it seems difficult to support them.

activerecord-jdbc-adapter has only been tested with "7-0-stable" and does not yet seem to support Rails v7.1.

yahonda commented 11 months ago

This RegexpError looks reported at https://github.com/oracle/truffleruby/issues/3287

hsbt commented 11 months ago

@eregon @headius Can you look this? JRuby and TruffleRuby block Rails 7.1 support of config gem.

eregon commented 11 months ago

I think a practical workaround for now is to change https://github.com/rubyconfig/config/pull/344/files#diff-635b20966b1d2fea76ee0565254eab939d55f6d22e3c4727cf9d453f589b87a0R30 to just if RUBY_ENGINE == 'ruby' && RUBY_VERSION >= '2.7' and skip Rails 7.0/7.1 on jruby & truffleruby.

Also in CI I noticed that jruby & truffleruby fail on Rails 7.0, but they might be fine with 7.1, so could you try running 7.0 only on CRuby and 7.1 on everything?

This RegexpError looks reported at oracle/truffleruby#3287

Indeed, that should get fixed soon on truffleruby-head, @nirvdrum is working on a fix for that.

headius commented 11 months ago

There should be no language issues supporting Rails 7.1, but we are in progress updating the adapters right now.

headius commented 11 months ago

FYI master of activerecord-jdbc-adapter has a few small updates to get a SQLite specs running again but a full update for 7.1 will take a bit longer.

pkuczynski commented 11 months ago

Also in CI I noticed that jruby & truffleruby fail on Rails 7.0, but they might be fine with 7.1, so could you try running 7.0 only on CRuby and 7.1 on everything?

Tried and failed: https://github.com/rubyconfig/config/actions/runs/6566111630?pr=344

I will temporarily skip testing rails-7 on jruby and truffle ruby. Can you let me know when issues gets fixed, so I will re-enable?

pkuczynski commented 11 months ago

@eregon @headius I made a sparate PR #345 enabling truffleruby and jruby, so I won't forget it. Please let me know when I can test again...