From 287e9a1924cbfdf3394b9e23489b98955128aafb Mon Sep 17 00:00:00 2001 From: Mitsuhiro Shibuya Date: Sun, 14 Apr 2024 14:30:38 +0900 Subject: [PATCH] Only load fog-rackspace on Rails 6.x due to incompatibility with fog-core Refs. https://github.com/fog/fog-rackspace/issues/43 --- carrierwave.gemspec | 1 - gemfiles/rails-6-0.gemfile | 3 ++- gemfiles/rails-6-1.gemfile | 3 ++- gemfiles/rails-7-0.gemfile | 2 +- gemfiles/rails-7-1.gemfile | 2 +- gemfiles/rails-main.gemfile | 2 +- spec/storage/fog_spec.rb | 6 +++++- 7 files changed, 12 insertions(+), 7 deletions(-) diff --git a/carrierwave.gemspec b/carrierwave.gemspec index 55da2d56d..4a003b989 100644 --- a/carrierwave.gemspec +++ b/carrierwave.gemspec @@ -35,7 +35,6 @@ Gem::Specification.new do |s| s.add_development_dependency "fog-aws" s.add_development_dependency "fog-google", ["~> 1.7", "!= 1.12.1"] s.add_development_dependency "fog-local" - s.add_development_dependency "fog-rackspace" s.add_development_dependency "mini_magick", ">= 3.6.0" if RUBY_ENGINE != 'jruby' diff --git a/gemfiles/rails-6-0.gemfile b/gemfiles/rails-6-0.gemfile index 788ed6cff..d662daea0 100644 --- a/gemfiles/rails-6-0.gemfile +++ b/gemfiles/rails-6-0.gemfile @@ -2,8 +2,9 @@ source "https://rubygems.org" gem "rails", "~> 6.0.0" gem "activemodel-serializers-xml" -gem 'sqlite3', platforms: :ruby +gem "sqlite3", platforms: :ruby gem "activerecord-jdbcsqlite3-adapter", platform: [:jruby, :truffleruby] gem "fog-google", "~> 1.13.0" if RUBY_VERSION < '2.7' +gem "fog-rackspace" gemspec :path => "../" diff --git a/gemfiles/rails-6-1.gemfile b/gemfiles/rails-6-1.gemfile index dd2411f88..8c3f6714b 100644 --- a/gemfiles/rails-6-1.gemfile +++ b/gemfiles/rails-6-1.gemfile @@ -2,8 +2,9 @@ source "https://rubygems.org" gem "rails", "~> 6.1.0" gem "activemodel-serializers-xml" -gem 'sqlite3', platforms: :ruby +gem "sqlite3", platforms: :ruby gem "activerecord-jdbcsqlite3-adapter", platform: [:jruby, :truffleruby] gem "fog-google", "~> 1.13.0" if RUBY_VERSION < '2.7' +gem "fog-rackspace" gemspec :path => "../" diff --git a/gemfiles/rails-7-0.gemfile b/gemfiles/rails-7-0.gemfile index 6dee328c3..030fff33d 100644 --- a/gemfiles/rails-7-0.gemfile +++ b/gemfiles/rails-7-0.gemfile @@ -2,7 +2,7 @@ source "https://rubygems.org" gem "rails", "~> 7.0.0" gem "activemodel-serializers-xml" -gem 'sqlite3', platforms: :ruby +gem "sqlite3", platforms: :ruby gem "activerecord-jdbcsqlite3-adapter", platform: [:jruby, :truffleruby] gemspec :path => "../" diff --git a/gemfiles/rails-7-1.gemfile b/gemfiles/rails-7-1.gemfile index 582ea0066..23697ebfc 100644 --- a/gemfiles/rails-7-1.gemfile +++ b/gemfiles/rails-7-1.gemfile @@ -2,7 +2,7 @@ source "https://rubygems.org" gem "rails", "~> 7.1.0" gem "activemodel-serializers-xml" -gem 'sqlite3', platforms: :ruby +gem "sqlite3", platforms: :ruby gem "activerecord-jdbcsqlite3-adapter", platform: [:jruby, :truffleruby] gem "observer" # Workaround for https://github.com/rmagick/rmagick/pull/1411 diff --git a/gemfiles/rails-main.gemfile b/gemfiles/rails-main.gemfile index c4a28d63b..b8c6e42a6 100644 --- a/gemfiles/rails-main.gemfile +++ b/gemfiles/rails-main.gemfile @@ -2,7 +2,7 @@ source "https://rubygems.org" gem "rails", github: "rails/rails", branch: "main" gem "activemodel-serializers-xml" -gem 'sqlite3', platforms: :ruby +gem "sqlite3", platforms: :ruby gem "activerecord-jdbcsqlite3-adapter", platform: [:jruby, :truffleruby] gemspec :path => "../" diff --git a/spec/storage/fog_spec.rb b/spec/storage/fog_spec.rb index f4a5eb9c0..6957e67e2 100644 --- a/spec/storage/fog_spec.rb +++ b/spec/storage/fog_spec.rb @@ -2,7 +2,11 @@ require 'fog/aws' require 'fog/google' require 'fog/local' -require 'fog/rackspace' +begin + require 'fog/rackspace' +rescue LoadError + # Can be missing in CI +end unless ENV['REMOTE'] == 'true' Fog.mock!