首页 > 解决方案 > 无法进入 Heroku Rails 控制台

问题描述

我目前正在开发一个 ruby​​-on-rails 应用程序。我的 Heroku 和 rails 已更新到最新版本,我的应用程序在 Heroku 上功能齐全。我目前使用的 API 是 Bootstrap、Carrierwave、AWS S3 和 Stripe。

每次我运行Heroku run rails console我都会收到此错误:

        31: from /app/bin/rails:9:in `<main>'
        30: from /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
        29: from /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
        28: from /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
        27: from /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
        26: from /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
        25: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.4/lib/rails/commands.rb:18:in `<top (required)>'
        24: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.4/lib/rails/command.rb:46:in `invoke'
        23: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.4/lib/rails/command/base.rb:69:in `perform'
        22: from /app/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
        21: from /app/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
        20: from /app/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
        19: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.4/lib/rails/commands/console/console_command.rb:95:in `perform'
        18: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.4/lib/rails/command/actions.rb:14:in `require_application_and_environment!'
        17: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.4/lib/rails/command/actions.rb:22:in `require_application!'
        16: from /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
        15: from /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
        14: from /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
        13: from /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
        12: from /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
        11: from /app/config/application.rb:2:in `<top (required)>'
        10: from /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
         9: from /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
         8: from /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
         7: from /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
         6: from /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
         5: from /app/vendor/bundle/ruby/2.5.0/gems/carrierwave-2.0.2/lib/carrierwave.rb:59:in `<top (required)>'
         4: from /app/vendor/bundle/ruby/2.5.0/gems/carrierwave-2.0.2/lib/carrierwave.rb:60:in `<module:CarrierWave>'
         3: from /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/active_support.rb:58:in `load_missing_constant'
         2: from /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/active_support.rb:79:in `rescue in load_missing_constant'
         1: from /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/active_support.rb:8:in `without_bootsnap_cache'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/active_support.rb:79:in `block in load_missing_constant': uninitialized constant Rails::Railtie (NameError)

标签: ruby-on-railsrubyherokurails-consoleheroku-cli

解决方案


推荐阅读