我安装了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>'
答案 0 :(得分:0)
使用
解决heroku run rails console
到目前为止,我总是使用heroku run console
。对于将来遇到此问题的人来说,这可能是有用的信息。