我试图访问我的生产postgresql数据库上的heroku使用以下命令从Windows命令行:
> heroku pg:psql
但是,我收到以下错误。 我确定net-ssh包含在gem'net -ssh','2.9.3.beta1'的gemfile中 ,然后我删除了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>'
我想到了。 这与我安装Heroku工具栏后安装的Ruby版本有关。 所以我只是卸载并重新安装Heroku的工具带,如下所示:
我希望这可以帮助别人。