私はherokuにプッシュしましたが、アプリケーションは実行されません。私はそれがdotenvの宝石のためであることがわかります。これを回避する方法はありますか?基本的な認証ユーザー名とパスワードを暗号化するためには、ドットエンブの宝石が必要です。私は、これが単純なアプリケーションなので、deviseやその複雑さの何も使用しないことを好みます。アプリケーションはherokuにプッシュされましたが、dotenv gemのために動作しません
以下は私のheroku端末の出力ですが、唯一の問題は本当にエラーを見つける方法を知りません/出力を読むことです。
/app/config/application.rb:4:in `require': cannot load such file -- dotenv (LoadError)
from /app/config/application.rb:4:in `<top (required)>'
from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:141:in `require'
from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:141:in `require_application_and_environment!'
from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:67:in `console'
from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5/lib/rails/commands.rb:17:in `<top (required)>'
from /app/bin/rails:9:in `require'
from /app/bin/rails:9:in `<main>'
gem 'rails', '4.2.5'
gem 'pg'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
gem 'will_paginate', '~> 3.1.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
gem "font-awesome-rails"
gem 'dotenv-rails', :groups => [:development, :test]
gem 'will_paginate-bootstrap'
gem "paperclip", "~> 5.0.0"
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
end
group :development do
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
# gem 'dotenv-heroku'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
end
すぐにロードする必要があるかどうかわかりません。新しいものです。基本認証を使うだけです。私が見つけることができる唯一の行はapplication.rbファイルです: 'require' dotenv '; Dotenv.load ".env.local"、 ".env。#{Rails.env}" 'その行を削除すると、rakeアセットを実行させることはできません:別の問題かもしれませんが、それは素晴らしいと思ういくつかの光。 – user2026178