目標:ローカル開発環境とブラウザを接続したい
mba:centos mango$ vim vagrantfile
で#config.vm.network “private_network”, ip: “192.168.33.10のコメントアウトをしたいのですが、その行が出てこずに、
accessing "localhost:8080" will access port 80 on the guest machine.
の行で終わっていて、コメントアウトできません。
なので、IPアドレスを入力してブラウザから接続しようとした際に、接続拒否されて困っています。
助けてください。
lang
1 2# -*- mode: ruby -*- 3# vi: set ft=ruby : 4 5# All Vagrant configuration is done below. The "2" in Vagrant.configure 6# configures the configuration version (we support older styles for 7# backwards compatibility). Please don't change it unless you know what 8# you're doing. 9Vagrant.configure("2") do |config| 10 # The most common configuration options are documented and commented below. 11 # For a complete reference, please see the online documentation at 12 # https://docs.vagrantup.com. 13 14 # Every Vagrant development environment requires a box. You can search for 15 # boxes at https://vagrantcloud.com/search. 16 config.vm.box = "centos/7" 17 18 # Disable automatic box update checking. If you disable this, then 19 # boxes will only be checked for updates when the user runs 20 # `vagrant box outdated`. This is not recommended. 21 # config.vm.box_check_update = false 22 23 # Create a forwarded port mapping which allows access to a specific port 24 # within the machine from a port on the host machine. In the example below, 25 # accessing "localhost:8080" will access port 80 on the guest machine. 26"vagrantfile" 70L, 3013C 27
Vagrantfileの内容をすべてコピペしてください。CODEタグで囲うのをお忘れなく。
追加しました!確認よろしくお願いします!
これ、壊れてますね。作り直すべきかと。それか、単にvimの使い方が分かってないだけかと思いますが、どちらでしょうか?
質問の内容と併せて、「accessing "localhost:8080"…」の行から下にvimでスクロールできない、と言うことでしょうか。ずーっと下の方にカーソルを移動させても、当該行が最後の行であると?
回答ありがとうございます!超初心者なので、どちらがボトルネックなのか判断できません!その点も踏まえた上で回答していただけると幸いです!
はい!カーソル移動はこれ以上できません!
一番下に70Lとあるように70行あるはずなので、スクロールできていないだけでしょう。vimの使い方についてはググってみてください。
回答2件
あなたの回答
tips
プレビュー