I'm getting a error message when deploying my rails application to heroku
I'm coding in a Windows laptop.
I get two distinct errors (I think they may be related).
First:
remote: /usr/bin/env: ‘ruby.exe\r’: No such file or directory
Then:
remote: Detecting rails configuration failed
I searched in Stackoverflow to see for solutions, I tried to apply:
windows heroku run rake db:migrate error "/usr/bin/env: ruby.exe: No such file or directory"
And it doesn't work.
Also I've tried to execute in my git bash:
dos2unix bin/bundle bin/rake bin/rails
What I have noticed is that it doesnt matter that I've changed ruby.exe to ruby (as said above), heroku still deploys looking for ruby.exe\r
This is the second time I deploy a Rails project in heroku, the first time I didnt have any problems, the second time I cloned the project and used it as template, with a different git repository.
Thanks!
UPDATE 2:
I can run it with no problems using heroku local so Im not sure whats causin the error.
EDIT 3
Well, I applied what is in these 2 answers: heroku /usr/bin/env: ‘ruby.exe\r’: No such file or directory problem https://help.github.com/en/articles/dealing-with-line-endings
Now the: 'remote: /usr/bin/env: ‘ruby.exe\r’: No such file or directory'
Doesn't appear anymore.
Still getting the rails configuration failed. These are the logs:
(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>'