Ошибка при развертывании Heroku: `неинициализированная константа Project::Dotenv`

У меня есть проблема при развертывании моего кода на heroku (хотя он хорошо работает на локальном):



   Bundle completed (172.18s)
           Cleaning up the bundler cache.
           Warning: the running version of Bundler (1.15.2) is older than the version that created the lockfile (1.17.1). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
           The latest bundler is 2.0.1, but you are currently running 1.15.2.
           To update, run `gem install bundler`
    -----> Installing node-v10.14.1-linux-x64
    -----> Installing yarn-v1.12.3
    -----> Detecting rake tasks
     !
     !     Could not detect rake tasks
     !     ensure you can run `$ bundle exec rake -P` against your app
     !     and using the production group of your Gemfile.
     !     rake aborted!
     !     NameError: uninitialized constant Project::Dotenv
     !     /tmp/build_082738362a529020c28178051c3a4113/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/active_support.rb:76:in `block in load_missing_constant'
     !     /tmp/build_082738362a529020c28178051c3a4113/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/active_support.rb:8:in `without_bootsnap_cache'
     !     /tmp/build_082738362a529020c28178051c3a4113/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/active_support.rb:76:in `rescue in load_missing_constant'
     !     /tmp/build_082738362a529020c28178051c3a4113/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/active_support.rb:58:in `load_missing_constant'
     !     /tmp/build_082738362a529020c28178051c3a4113/config/application.rb:28:in `<module:GoodMeal>'
     !     /tmp/build_082738362a529020c28178051c3a4113/config/application.rb:9:in `<top (required)>'
     !     /tmp/build_082738362a529020c28178051c3a4113/Rakefile:4:in `require_relative'
     !     /tmp/build_082738362a529020c28178051c3a4113/Rakefile:4:in `<top (required)>'
     !     /tmp/build_082738362a529020c28178051c3a4113/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/lib/rake/rake_module.rb:29:in `load'
     !     /tmp/build_082738362a529020c28178051c3a4113/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/lib/rake/rake_module.rb:29:in `load_rakefile'
     !     /tmp/build_082738362a529020c28178051c3a4113/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/lib/rake/application.rb:703:in `raw_load_rakefile'
     !     /tmp/build_082738362a529020c28178051c3a4113/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/lib/rake/application.rb:104:in `block in load_rakefile'
     !     /tmp/build_082738362a529020c28178051c3a4113/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/lib/rake/application.rb:186:in `standard_exception_handling'
     !     /tmp/build_082738362a529020c28178051c3a4113/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/lib/rake/application.rb:103:in `load_rakefile'
     !     /tmp/build_082738362a529020c28178051c3a4113/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/lib/rake/application.rb:82:in `block in run'
     !     /tmp/build_082738362a529020c28178051c3a4113/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/lib/rake/application.rb:186:in `standard_exception_handling'
     !     /tmp/build_082738362a529020c28178051c3a4113/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/lib/rake/application.rb:80:in `run'
     !     /tmp/build_082738362a529020c28178051c3a4113/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/exe/rake:27:in `<top (required)>'
     !     vendor/bundle/bin/rake:17:in `load'
     !     vendor/bundle/bin/rake:17:in `<main>'
     !     
     !     Caused by:
     !     NameError: uninitialized constant Project::Dotenv
     !     /tmp/build_082738362a529020c28178051c3a4113/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/active_support.rb:60:in `block in load_missing_constant'
     !     /tmp/build_082738362a529020c28178051c3a4113/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/active_support.rb:16:in `allow_bootsnap_retry'
     !     /tmp/build_082738362a529020c28178051c3a4113/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/active_support.rb:59:in `load_missing_constant'
     !     /tmp/build_082738362a529020c28178051c3a4113/config/application.rb:28:in `<module:GoodMeal>'
     !     /tmp/build_082738362a529020c28178051c3a4113/config/application.rb:9:in `<top (required)>'
     !     /tmp/build_082738362a529020c28178051c3a4113/Rakefile:4:in `require_relative'
     !     /tmp/build_082738362a529020c28178051c3a4113/Rakefile:4:in `<top (required)>'
     !     /tmp/build_082738362a529020c28178051c3a4113/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/lib/rake/rake_module.rb:29:in `load'
     !     /tmp/build_082738362a529020c28178051c3a4113/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/lib/rake/rake_module.rb:29:in `load_rakefile'
     !     /tmp/build_082738362a529020c28178051c3a4113/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/li...


Так что, видимо, из-за dotenv драгоценный камень, но я никогда не делал никаких изменений на этом драгоценном камне, и до сих пор он работал нормально.

Также есть предупреждение о пакете, так что, возможно, это из-за этого. Спасибо за вашу помощь!

вот мой гемфайл:

source 'https://rubygems.org'
ruby '2.5.3'

gem 'bootsnap', require: false
gem 'jbuilder', '~> 2.0'
gem 'pg', '~> 0.21'
gem 'puma'
gem 'sassc-rails'
gem 'sass-rails', require: false
gem 'bootstrap-sass', '~> 3.3'
gem 'font-awesome-sass', '~> 5.0.9'
gem 'rails', '5.2.1'
gem 'redis'

gem 'autoprefixer-rails'
gem 'simple_form'
gem 'uglifier'
gem 'webpacker'
gem 'devise'
gem 'money-rails'
gem "pundit"
gem 'postmark-rails'
gem 'gibbon'
# gem 'figaro'

group :development do
  gem 'web-console', '>= 3.3.0'
end

group :development, :test do
    gem 'letter_opener'
  gem 'pry-byebug'
  gem 'pry-rails'
  gem 'listen', '~> 3.0.5'
  gem 'spring'
  gem 'spring-watcher-listen', '~> 2.0.0'
  gem 'dotenv-rails', :require => 'dotenv/rails-now'
  gem 'dotenv'
end

0 ответов

Другие вопросы по тегам