为我的rails应用程序安装了heroku PGbouncer buildpack。控制台无法再访问模型或活动记录

时间:2018-02-15 16:05:14

标签: ruby-on-rails heroku activerecord buildpack

我安装了PGbouncer以帮助处理事务池,到目前为止它似乎有所帮助。但是,当我执行heroku run console时,我的连接无法访问ActiveRecord或任何模型。

NameError: uninitialized constant ActiveRecord
    from (irb):8
    from /app/vendor/bundle/ruby/2.3.0/gems/countries-2.1.2/bin/console:14:in `<top (required)>'
    from /app/vendor/bundle/bin/console:17:in `load'
    from /app/vendor/bundle/bin/console:17:in `<main>'

irb(main):011:0> User
NameError: uninitialized constant User
    from (irb):11
    from /app/vendor/bundle/ruby/2.3.0/gems/countries-2.1.2/bin/console:14:in `<top (required)>'
    from /app/vendor/bundle/bin/console:17:in `load'
    from /app/vendor/bundle/bin/console:17:in `<main>'

1 个答案:

答案 0 :(得分:0)

使用

解决
heroku run rails console

到目前为止,我总是使用heroku run console。对于将来遇到此问题的人来说,这可能是有用的信息。