Skip to content

Commit

Permalink
Manually check optional Rails dependency version
Browse files Browse the repository at this point in the history
  • Loading branch information
bkeepers committed Feb 13, 2024
1 parent dd40e1c commit f55afd8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/dotenv/rails.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Since rubygems doesn't support optional dependencies, we have to manually check
unless Gem::Requirement.new(">= 6.1").satisfied_by?(Gem::Version.new(Rails.version))
warn "dotenv 3.0 only supports Rails 6.1 or later. Use dotenv ~> 2.0."
return
end

require "dotenv"
require "dotenv/replay_logger"
require "dotenv/log_subscriber"
Expand Down

0 comments on commit f55afd8

Please sign in to comment.