Rails развернуть на heroku "Обнаружение сбоя конфигурации rails" и "/ usr / bin / env: 'ruby.exe \ r': такого файла или каталога нет" - PullRequest
0 голосов
/ 25 апреля 2019

Я получаю сообщение об ошибке при развертывании моего приложения rails на heroku

Я пишу код на ноутбуке с Windows.

Я получаю две отчетливые ошибки (думаю, они могут быть связаны).

Первый:

remote: /usr/bin/env: ‘ruby.exe\r’: No such file or directory

Тогда:

remote: Detecting rails configuration failed

Я искал в Stackoverflow, чтобы найти решения, я пытался применить:

windows heroku запустить rake db: ошибка переноса "/ usr / bin / env: ruby.exe: такого файла или каталога нет"

И это не работает.

Также я попытался выполнить в моем git bash:

dos2unix bin/bundle bin/rake bin/rails

Что я заметил, так это то, что не имеет значения, что я изменил ruby.exe на ruby ​​(как сказано выше), heroku все еще развертывается в поисках ruby.exe\r

Это второй раз, когда я развертываю проект Rails в heroku, в первый раз у меня не было проблем, во второй раз я клонировал проект и использовал его в качестве шаблона с другим git-репозиторием.

Спасибо!

ОБНОВЛЕНИЕ 2:

Я могу запустить его без проблем, используя heroku local , поэтому я не уверен, что является причиной ошибки.

РЕДАКТИРОВАТЬ 3

Ну, я применил то, что в этих 2 ответах heroku / usr / bin / env: ‘ruby.exe \ r’: нет такой проблемы с файлом или каталогом https://help.github.com/en/articles/dealing-with-line-endings

Теперь: 'remote: / usr / bin / env: ‘ruby.exe \ r’: нет такого файла или каталога'

Больше не появляется.

Не удалось получить конфигурацию направляющих. Это журналы:

(erb):12:in `<main>': undefined method `[]' for nil:NilClass (NoMethodError)
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/ruby-2.5.3/lib/ruby/2.5.0/erb.rb:876:in `eval'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/ruby-2.5.3/lib/ruby/2.5.0/erb.rb:876:in `result'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/activestorage-5.2.3/lib/active_storage/engine.rb:95:in `block (2 levels) in <class:Engine>'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/lazy_load_hooks.rb:71:in `instance_eval'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/lazy_load_hooks.rb:71:in `block in execute_hook'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/lazy_load_hooks.rb:62:in `with_execution_control'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/lazy_load_hooks.rb:67:in `execute_hook'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/lazy_load_hooks.rb:52:in `block in run_load_hooks'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/lazy_load_hooks.rb:51:in `each'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/lazy_load_hooks.rb:51:in `run_load_hooks'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/activestorage-5.2.3/app/models/active_storage/blob.rb:235:in `<class:Blob>'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/activestorage-5.2.3/app/models/active_storage/blob.rb:16:in `<top (required)>'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:378:in `block in require_or_load'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:37:in `block in load_interlock'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies/interlock.rb:14:in `block in loading'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/concurrency/share_lock.rb:151:in `exclusive'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies/interlock.rb:13:in `loading'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:37:in `load_interlock'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:356:in `require_or_load'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/active_support.rb:48:in `block in require_or_load'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/active_support.rb:16:in `allow_bootsnap_retry'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/active_support.rb:47:in `require_or_load'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:334:in `depend_on'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/active_support.rb:85:in `depend_on'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:246:in `require_dependency'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/engine.rb:478:in `block (2 levels) in eager_load!'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/engine.rb:477:in `each'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/engine.rb:477:in `block in eager_load!'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/engine.rb:475:in `each'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/engine.rb:475:in `eager_load!'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/engine.rb:356:in `eager_load!'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/application/finisher.rb:69:in `each'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/application/finisher.rb:69:in `block in <module:Finisher>'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/initializable.rb:32:in `instance_exec'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/initializable.rb:32:in `run'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/initializable.rb:61:in `block in run_initializers'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/ruby-2.5.3/lib/ruby/2.5.0/tsort.rb:228:in `block in tsort_each'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/ruby-2.5.3/lib/ruby/2.5.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/ruby-2.5.3/lib/ruby/2.5.0/tsort.rb:431:in `each_strongly_connected_component_from'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/ruby-2.5.3/lib/ruby/2.5.0/tsort.rb:349:in `block in each_strongly_connected_component'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/ruby-2.5.3/lib/ruby/2.5.0/tsort.rb:347:in `each'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/ruby-2.5.3/lib/ruby/2.5.0/tsort.rb:347:in `call'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/ruby-2.5.3/lib/ruby/2.5.0/tsort.rb:347:in `each_strongly_connected_component'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/ruby-2.5.3/lib/ruby/2.5.0/tsort.rb:226:in `tsort_each'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/ruby-2.5.3/lib/ruby/2.5.0/tsort.rb:205:in `tsort_each'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/initializable.rb:60:in `run_initializers'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/application.rb:361:in `initialize!'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/config/environment.rb:5:in `<top (required)>'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/application.rb:337:in `require_environment!'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/command/actions.rb:28:in `require_environment!'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/command/actions.rb:15:in `require_application_and_environment!'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/commands/runner/runner_command.rb:29:in `perform'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/command/base.rb:65:in `perform'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/command.rb:46:in `invoke'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/commands.rb:18:in `<top (required)>'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
remote:         from /tmp/build_1139d3f60c8f9853c7eca09a6e6cc23a/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
remote:         from bin/rails:4:in `<main>'

Ответы [ 2 ]

0 голосов
/ 25 апреля 2019

Ну, я исправил это, выполнив следующее:

Я устанавливаю конфигурацию:

heroku config:set AWS_ACCESS_KEY_ID=<something>
heroku config:set AWS_SECRET_ACCESS_KEY=<something>
heroku config:set AWS_REGION=<something>
heroku config:set S3_BUCKET_NAME=<something>

Это не совсем помогло, но опять же, я заметил, что мне не хватает master.key.

Я также удостоверился, что мой config / enviroment / production.rb имел:

config.require_master_key = true

Итак, я добавил конфиг также:

heroku config:set RAILS_MASTER_KEY=<something>

После этого я снова сделал 'git push heroku master'

И это сработало.

0 голосов
/ 25 апреля 2019

запустите обновление пакета, удалите git Heroku и снова создайте приложение heroku

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...