I am trying to deploy a rails app that I developed locally on to Heroku but I am running across the following error when ever I run
git push heroku origin
remote: !
remote: ! Could not detect rake tasks
remote: ! ensure you can run `$ bundle exec rake -P` against your app
remote: ! and using the production group of your Gemfile.
remote: ! /tmp/build_fd23eb4a/bin/rake:4:in `require': cannot load such file -- rake (LoadError)
remote: ! from /tmp/build_fd23eb4a/bin/rake:4:in `<main>'
remote: !
I tried running bundle exec rake -P RAILS_ENV=production with the following output:
rake about
environment
rake action_mailbox:ingress:environment
rake action_mailbox:ingress:exim
action_mailbox:ingress:environment
rake action_mailbox:ingress:postfix
action_mailbox:ingress:environment
rake action_mailbox:ingress:qmail
action_mailbox:ingress:environment
rake action_mailbox:install
rake action_mailbox:install:migrations
rake action_text:install
rake action_text:install:migrations
rake active_storage:install
environment
rake active_storage:install:migrations
rake active_storage:update
environment
rake app:binstub:yarn
rake app:template
environment
rake app:templates:copy
rake app:update
update:configs
update:bin
update:active_storage
update:upgrade_guide_info
rake app:update:active_storage
rake app:update:bin
rake app:update:configs
rake app:update:upgrade_guide_info
rake assets:clean
environment
rake assets:clobber
environment
rake assets:environment
rake assets:precompile
environment
yarn:install
rake cache_digests:dependencies
environment
rake cache_digests:nested_dependencies
environment
rake db:_dump
rake db:abort_if_pending_migrations
load_config
rake db:charset
load_config
rake db:check_protected_environments
load_config
rake db:collation
load_config
rake db:create
load_config
rake db:create:all
load_config
rake db:drop
load_config
check_protected_environments
rake db:drop:_unsafe
load_config
rake db:drop:all
load_config
check_protected_environments
rake db:environment:set
load_config
rake db:fixtures:identify
load_config
rake db:fixtures:load
load_config
rake db:forward
load_config
rake db:load_config
environment
rake db:migrate
load_config
rake db:migrate:down
load_config
rake db:migrate:redo
load_config
rake db:migrate:reset
db:drop
db:create
db:migrate
rake db:migrate:status
load_config
rake db:migrate:up
load_config
rake db:prepare
load_config
rake db:purge
load_config
check_protected_environments
rake db:purge:all
load_config
check_protected_environments
rake db:reset
db:drop
db:setup
rake db:rollback
load_config
rake db:schema:cache:clear
load_config
rake db:schema:cache:dump
load_config
rake db:schema:dump
load_config
rake db:schema:load
load_config
check_protected_environments
rake db:schema:load_if_ruby
db:create
environment
rake db:seed
load_config
rake db:seed:replant
load_config
truncate_all
seed
rake db:setup
db:create
environment
db:schema:load
seed
rake db:structure:dump
load_config
rake db:structure:load
load_config
check_protected_environments
rake db:structure:load_if_sql
db:create
environment
rake db:test:load
db:test:purge
rake db:test:load_schema
db:test:purge
rake db:test:load_structure
db:test:purge
rake db:test:prepare
load_config
rake db:test:purge
load_config
check_protected_environments
rake db:truncate_all
load_config
check_protected_environments
rake db:version
load_config
rake default
test
rake environment
rake log:clear
rake middleware
environment
rake railties:install:migrations
db:load_config
rake restart
rake secret
rake stats
rake test
rake test:all
test:prepare
rake test:channels
test:prepare
rake test:controllers
test:prepare
rake test:db
db:test:prepare
test
rake test:functionals
test:prepare
rake test:generators
test:prepare
rake test:helpers
test:prepare
rake test:integration
test:prepare
rake test:jobs
test:prepare
rake test:mailboxes
test:prepare
rake test:mailers
test:prepare
rake test:models
test:prepare
rake test:prepare
rake test:run
test
rake test:system
test:prepare
rake test:units
test:prepare
rake time:zones
rake time:zones:all
rake time:zones:local
rake time:zones:us
rake tmp
rake tmp/cache
rake tmp/cache/assets
rake tmp/pids
rake tmp/sockets
rake tmp:cache:clear
rake tmp:clear
tmp:cache:clear
tmp:sockets:clear
tmp:screenshots:clear
rake tmp:create
tmp/cache
tmp/sockets
tmp/pids
tmp/cache/assets
rake tmp:pids:clear
rake tmp:screenshots:clear
rake tmp:sockets:clear
rake webpacker
rake webpacker:binstubs
check_node
check_yarn
rake webpacker:check_binstubs
rake webpacker:check_node
rake webpacker:check_yarn
rake webpacker:clean
webpacker:verify_install
environment
rake webpacker:clobber
webpacker:verify_install
environment
rake webpacker:compile
webpacker:verify_install
environment
rake webpacker:info
rake webpacker:install
check_node
check_yarn
rake webpacker:install:angular
webpacker:verify_install
rake webpacker:install:coffee
webpacker:verify_install
rake webpacker:install:elm
webpacker:verify_install
rake webpacker:install:erb
webpacker:verify_install
rake webpacker:install:react
webpacker:verify_install
rake webpacker:install:stimulus
webpacker:verify_install
rake webpacker:install:svelte
webpacker:verify_install
rake webpacker:install:typescript
webpacker:verify_install
rake webpacker:install:vue
webpacker:verify_install
rake webpacker:verify_install
check_node
check_yarn
check_binstubs
rake webpacker:yarn_install
rake yarn:install
rake zeitwerk:check
environment
I have tried updating and reinstalling bundler to see if that would help but the issue persists. I am at a loss as to what could be causing this. Here is my rake file as well.
require_relative "config/application"
Rails.application.load_tasks