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

Fix NoMethodError when using dotenv without Rails. #394

Merged
merged 1 commit into from
Jun 24, 2019

Conversation

y-yagi
Copy link
Contributor

@y-yagi y-yagi commented Jun 24, 2019

This reverts commit 00e14aa.

Reason: The pure Ruby doesn't have Array#present?. So this cause NoMethodError when using dotenv without Rails.

$ dotenv -t .env
Traceback (most recent call last):
	3: from /bin/dotenv:23:in `<main>'
	2: from /bin/dotenv:23:in `load'
	1: from /lib/ruby/gems/2.5.0/gems/dotenv-2.7.3/bin/dotenv:4:in `<top (required)>'
/lib/ruby/gems/2.5.0/gems/dotenv-2.7.3/lib/dotenv/cli.rb:25:in `run': undefined method `present?' for []:Array (NoMethodError)
Did you mean?  prepend

…ons_change"

This reverts commit 00e14aa, reversing
changes made to f796d36.

Reason: The pure Ruby doesn't have `Array#present?`. So this cause
`NoMethodError` when using dotenv without Rails.

```
$ dotenv -t .env
Traceback (most recent call last):
	3: from /bin/dotenv:23:in `<main>'
	2: from /bin/dotenv:23:in `load'
	1: from /lib/ruby/gems/2.5.0/gems/dotenv-2.7.3/bin/dotenv:4:in `<top (required)>'
/lib/ruby/gems/2.5.0/gems/dotenv-2.7.3/lib/dotenv/cli.rb:25:in `run': undefined method `present?' for []:Array (NoMethodError)
Did you mean?  prepend
```
Copy link
Collaborator

@cadwallion cadwallion left a comment

Choose a reason for hiding this comment

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

Thanks for the quick fix. The joys of Rails module extensions; never being able to remember what's a Ruby method and what's a Rails extension method. Cutting a release now.

@cadwallion cadwallion merged commit 52b9eda into bkeepers:master Jun 24, 2019
@y-yagi
Copy link
Contributor Author

y-yagi commented Jun 24, 2019

Thanks for your quick release!

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