2016-04-05 6 views
-1

私はPSequelをインストールしていて、自分のVagrant VMのRailsアプリにあるGUIでPGデータベースを表示したいと思っています。GUIを使用してVagrantボックスのPostgresデータベースにアクセスする

私は以下のイメージのように設定しましたが、接続することはできません。

enter image description here

PSequelが私に与えているエラーは、次のとおりです。

OpenSSH_6.9p1, LibreSSL 2.1.8 
debug1: Reading configuration data /Users/neil/.ssh/config 
debug1: Reading configuration data /etc/ssh/ssh_config 
debug1: /etc/ssh/ssh_config line 21: Applying options for * 
debug1: Connecting to localhost [127.0.0.1] port 22. 
debug1: connect to address 127.0.0.1 port 22: Connection refused 
debug1: Connecting to localhost [::1] port 22. 
debug1: connect to address ::1 port 22: Connection refused 
ssh: connect to host localhost port 22: Connection refused 

誰もが私が間違っているつもりですどこ知っていますか?マイVagrantfile

VAGRANTFILE_API_VERSION = "2" 

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| 
    # Every Vagrant virtual environment requires a box to build off of. 
    config.vm.box = "precise64" 

    # Set the hostname to the project here for easy identification 
    config.vm.hostname = "ntsite" 

    # The url from where the 'config.vm.box' box will be fetched if it 
    # doesn't already exist on the user's system. 
    config.vm.box_url = "http://files.vagrantup.com/precise64.box" 

    # Create a forwarded port mapping which allows access to a specific port 
    # within the machine from a port on the host machine. In the example below, 
    # accessing "localhost:8080" will access port 80 on the guest machine. 
    config.vm.network :forwarded_port, guest: 80, host: 8080 

    # Forward rails server port 3000 
    config.vm.network :forwarded_port, guest: 3000, host: 3000 

    # Forward elasticsearch server port 9200 
    config.vm.network :forwarded_port, guest: 9200, host: 9200 

    # If true, then any SSH connections made will enable agent forwarding. 
    config.ssh.forward_agent = true 

    config.ssh.keep_alive = true 

    config.vm.provider :virtualbox do |vb| 
    vb.memory = 512 
    vb.cpus = 1 
    end 

    # config.vm.synced_folder ".", "/vagrant", type: "rsync", rsync__exclude: ".git/" 

    config.vm.synced_folder "./src", "/vagrant/src", type: "rsync", mount_options: ["dmode=777","fmode=766"], rsync__auto: true, disabled: false 

    # Required for NFS to work, pick any local IP 
    # config.vm.network :private_network, ip: '192.168.50.50' 

    # Use NFS for shared folders for better performance 
    # config.vm.synced_folder "./src", "/vagrant/src", nfs: true 


    # Enable provisioning with Ansible, specifying the location of the playbook. 
    config.vm.provision "ansible" do |ansible| 
     ansible.playbook = "devbox/vagrant.yml" 
     # ansible.verbose = 'vv' 
    end 
end 

vagrant upを実行しているの出力:あなたが外部アドレスに耳を傾けるのPostgreSQLに指示する必要があるかもしれません

Bringing machine 'default' up with 'virtualbox' provider... 
==> default: Clearing any previously set forwarded ports... 
==> default: Clearing any previously set network interfaces... 
==> default: Preparing network interfaces based on configuration... 
    default: Adapter 1: nat 
==> default: Forwarding ports... 
    default: 80 => 8080 (adapter 1) 
    default: 3000 => 3000 (adapter 1) 
    default: 9200 => 9200 (adapter 1) 
    default: 22 => 2222 (adapter 1) 
==> default: Running 'pre-boot' VM customizations... 
==> default: Booting VM... 
==> default: Waiting for machine to boot. This may take a few minutes... 
    default: SSH address: 127.0.0.1:2222 
    default: SSH username: vagrant 
    default: SSH auth method: private key 
    default: Warning: Connection timeout. Retrying... 
==> default: Machine booted and ready! 
GuestAdditions 5.0.16 running --- OK. 
==> default: Checking for guest additions in VM... 
==> default: Setting hostname... 
==> default: Rsyncing folder: /Volumes/Storage1/Code/ntsite/src/ => /vagrant/src 
==> default: Mounting shared folders... 
    default: /vagrant => /Volumes/Storage1/Code/ntsite 
==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision` 
==> default: flag to force provisioning. Provisioners marked to run always will still run. 
+0

迷惑メールボックスはおそらく 'localhost'ではありません。 SSHポートがlocalhostに転送されている場合は、確かに別のポートに転送してください。あなたはどのようにして迷惑メールに接続しますか? – Jakuje

+0

私は通常、私の迷惑メールファイルが入っているディレクトリに移動して、迷惑行為を実行した後、迷惑メールsshを実行してログインします。私はブラウザでlocalhost:3000に移動して私のレールアプリケーションにアクセスしますか? – rctneil

+0

'vagrant up'コマンドの出力とあなたの' Vagrantfile'の内容を投稿してください –

答えて

関連する問題