我正在尝试使用Windows命令行中的以下命令访问heroku上的生产postgresql数据库:
> heroku pg:psql
但是,我收到以下错误。我确保net-ssh包含在我的gemfile中,其中包含 gem'net-ssh','2.9.3.beta1',然后我删除了gemfile.lock,并重新部署。任何帮助表示赞赏!
---> Connecting to DATABASE_URL
C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- dl/import (LoadError)
from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from C:/Users/user/.heroku/client/vendor/gems/net-ssh-2.9.2/lib/net/ssh/authentication/pageant.rb:1:in `<top (required)>'
from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from C:/Users/user/.heroku/client/vendor/gems/net-ssh-2.9.2/lib/net/ssh/authentication/agent/socket.rb:5:in `<top (required)>'
from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from C:/Users/user/.heroku/client/vendor/gems/net-ssh-2.9.2/lib/net/ssh/authentication/agent.rb:22:in `<top (required)>'
from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from C:/Users/user/.heroku/client/vendor/gems/net-ssh-2.9.2/lib/net/ssh/authentication/key_manager.rb:4:in `<top (required)>'
from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from C:/Users/user/.heroku/client/vendor/gems/net-ssh-2.9.2/lib/net/ssh/authentication/session.rb:4:in `<top (required)>'
from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from C:/Users/user/.heroku/client/vendor/gems/net-ssh-2.9.2/lib/net/ssh.rb:11:in `<top (required)>'
from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from C:/Users/user/.heroku/client/vendor/gems/net-ssh-gateway-1.2.0/lib/net/ssh/gateway.rb:2:in `<top (required)>'
from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from C:/Users/user/.heroku/client/lib/heroku/helpers/heroku_postgresql.rb:54:in `maybe_tunnel'
from C:/Users/user/.heroku/client/lib/heroku/command/pg.rb:150:in `psql'
from C:/Users/user/.heroku/client/lib/heroku/command.rb:212:in `run'
from C:/Users/user/.heroku/client/lib/heroku/cli.rb:30:in `start'
from C:/Heroku/bin/heroku:29:in `<main>'
答案 0 :(得分:1)
我明白了。它与我安装Heroku工具带后安装的Ruby版本有关。所以我刚刚卸载并重新安装了Heroku工具带,如下所示:
我希望这有助于某人。