【问题标题】:What caused bin/rails: compared with non class/module (TypeError)?是什么导致 bin/rails: 与非类/模块 (TypeError) 相比?
【发布时间】:2020-02-20 07:23:40
【问题描述】:

我正在将 Rails 从 Rails 5.0.6 升级到 5.1.7。 我运行了这个命令

bundle update composite_primary_keys rails activerecord-oracle_enhanced-adapter state_machines-activerecord

然后现在运行rails c 给出了这个:

Traceback (most recent call last):
bin/rails: compared with non class/module (TypeError)

我不知道如何开始修复

Traceback (most recent call last):
bin/rails: compared with non class/module (TypeError)

知道是什么导致了这个错误吗?

【问题讨论】:

  • 这是一个完整的输出吗?没有踪迹?
  • @katafrakt 是的,没有痕迹
  • 那可以发bin/rails的内容吗?也许它就在那里。
  • @katafrakt 感谢您对此进行调查,我认为bin/rails 显示与rails c 相同的输出(除了正常的300 端口内容)。我通过使用 `bundle update` 将其他 gem 升级到更高版本解决了这个问题。我将添加它作为这个问题的答案并选择它作为答案。再次感谢!

标签: ruby-on-rails ruby


【解决方案1】:

最后,运行bundle update解决了这个问题,rails c开始正常运行。我怀疑以下 gem 升级可能是解决此问题的方法:

发件人:

state_machines-activerecord (0.4.1)
  activerecord (>= 4.1, < 5.2)
  state_machines-activemodel (>= 0.3.0)

收件人:

state_machines-activerecord (0.6.0)
  activerecord (>= 4.1)
  state_machines-activemodel (>= 0.5.0)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-07-24
    • 2014-10-09
    • 1970-01-01
    • 2017-05-31
    • 1970-01-01
    • 2012-06-05
    • 1970-01-01
    相关资源
    最近更新 更多