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

Update dotenv to v1.0.0 to avoid obsolete method errors #119

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nikukyugamer
Copy link

@nikukyugamer nikukyugamer commented Jun 27, 2023

On Ruby v3.2 over, File.exists? has been removed.
ruby/ruby#5352

And dotenv less than v1.0.0 is used File.exists? so if using Ruby v3.2 later occurs the error as below.

$ RBENV_VERSION=3.2.2 bin/rails s
=> Booting Puma
=> Rails 6.1.7.3 application starting in development 
=> Run `bin/rails server --help` for more startup options
Exiting
/home/takiya/.ghq/github.com/nikukyugamer/auth0-rubyonrails-sample/sample/vendor/bundle/ruby/3.2.0/gems/dotenv-0.11.1/lib/dotenv.rb:6:in `block in load': undefined method `exists?' for File:Class (NoMethodError)

    with(*filenames) { |f| Environment.new(f).apply if File.exists?(f) }
                                                           ^^^^^^^^
Did you mean?  exist?

This deprecated method was removed on v1.0.0.
bkeepers/dotenv@85ad8c5

This PR fixed the above problem.

Note: The latest dotenv version is v2.8.1 but I adopted minimum safer.

@nikukyugamer nikukyugamer requested a review from a team as a code owner June 27, 2023 09:19
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