LoadError for dotenv / load when running Dotenv.load

I want to use dotenvin pure ruby ​​environments. I mean that I do not use Rails.

The github instruction states that there are two ways to load variables.

require 'dotenv/load'

# or
require 'dotenv'
Dotenv.load

In my environments, the latter method works, but require require dotenv / load causes this error:

LoadError: cannot load such file -- dotenv/load

I use Dotenv.loadif the previous method does not work, but I want to know the cause of the error.

I use ruby 2.3.3p222and dotenv (2.1.1). What am I doing wrong?

Additional Information

I use bundle exec pryalso `load 'myapp.rb'. When I load a script, I get an error.

+4
source share
1 answer

'dotenv / load' is implemented from 2.1.2or 2.2.0.

dotenv, .

+3

Source: https://habr.com/ru/post/1689771/


All Articles