Tell Vagrant the ip of the host machine

前端 未结 3 1876
日久生厌
日久生厌 2020-12-23 11:37

I am using a vagrant box as a development machine for a project with an odd dependency I can only seem to install on ubuntu.

I created my database and have my app co

3条回答
  •  攒了一身酷
    2020-12-23 12:30

    According to this, you can reach the host through the VM's default gateway.

    Running netstat -rn on the guest should give you the relevant info, on my machine changing your code above to the following looks like it would get things going for you:

    # database.yml
    development:
      host: <%= `netstat -rn | grep "^0.0.0.0 " | cut -d " " -f10` %>
    

提交回复
热议问题