流浪语法错误

时间:2018-08-29 01:40:33

标签: vagrant

我在这里有这段代码:

<button class=" btn-primary" type="button" data-toggle="collapse" data-target=".multi-collapse" aria-expanded="false" aria-controls=".multi-collapse" >
    <span class="glyphicon glyphicon-eye-open"></span></button>
    @foreach(App\Account::where('nomencloture', 'LIKE', '_')->get() as $item)


    <div  class="collapse multi-collapse" id="{{$item->nomencloture}}" >         
        <div class="list-group-item " >
            <div class="col-md-2"> {{ $item->account_id }}</div>
            <div class="col-md-2"> {{ $item->account_name }}</div>

            <button class=" btn-primary" type="button" data-toggle="collapse" data-target="#PUT SOMETHINGHERE" aria-expanded="false" aria-controls="multiCollapseExample1" >
                <span class="glyphicon glyphicon-eye-open"></span></button>       
                <br>
                <br>
                @foreach(App\Account::where('nomencloture', 'LIKE', '_______')->get() as $subitem)
                <div  class="collapse" id="{{ $subitem->nomencloture }}" >
                    <br>
                    <div class="list-group-item ">
                        <div class="col-md-2"> {{ $subitem->account_id }}</div>
                        <div class="col-md-2"> {{ $subitem->account_name }}</div>
                    </div>
                </div>                                   
                @endforeach
            </div>             

        </div>
        @endforeach

当我尝试做无业游民时,我得到了错误:

Vagrant.configure("2") do |config| 
    config.vm.define “web” do |web| 
        web.vm.box = "ubuntu/trusty64"                          web.vm.network :forwarded_port, guest: 80, host: 8080           web.vm.provision :puppet do |puppet|                            puppet.manifests_path = "manifests"                         puppet.manifest_file = "site.pp" 
        end 
    end 
    config.vm.define “db” do |db|  
        db.vm.box = "ubuntu/trusty64" 
        db.vm.network :forwarded_port, guest: 80, host: 8081            db.vm.provision :puppet do |puppet| 
            puppet.manifests_path = "manifests"                         puppet.manifest_file = "myweb.pp"  
            #remember you can use shell instead of puppet! 
        end 
    end 
end 

我很确定我的代码是正确的,但是为什么会抱怨呢?

1 个答案:

答案 0 :(得分:0)

您在webdb周围使用了智能引号(卷曲引号),而不是常规引号。这些引号是UTF-8字符,而不是常规ASCII(显然每个字符甚至使用多个字节)。

使用此:

Vagrant.configure("2") do |config| 
    config.vm.define "web" do |web| 
        web.vm.box = "ubuntu/trusty64"
        web.vm.network :forwarded_port, guest: 80, host: 8080
        web.vm.provision :puppet do |puppet|
            puppet.manifests_path = "manifests"
            puppet.manifest_file = "site.pp" 
        end 
    end

    config.vm.define "db" do |db|  
        db.vm.box = "ubuntu/trusty64" 
        db.vm.network :forwarded_port, guest: 80, host: 8081
        db.vm.provision :puppet do |puppet| 
            puppet.manifests_path = "manifests"
            puppet.manifest_file = "myweb.pp"  
            #remember you can use shell instead of puppet! 
        end 
    end 
end

顺便说一下,您如何编辑文件?代码编辑者通常不会使用智能引号。但是,如果您使用的是常规文本编辑器(如Mac上的TextEdit),它可能会自动将引号改正。