首页 \ 问答 \ 无法在Windows上使用rsync方法进行流浪(Can't vagrant up with rsync method on windows)

无法在Windows上使用rsync方法进行流浪(Can't vagrant up with rsync method on windows)

一旦我运行vagrant并在配置类型中使用rsync方法,我得到了以下错误

There was an error when attempting to rsync a synced folder.
Please inspect the error message below for more info.

Host path: /e/virtual-boxes/scotchbox/
Guest path: /var/www
Command: rsync --verbose --archive --delete -z --copy-links --chmod=ugo=rwX --no-perms --no-owner --no-group --rsync-path sudo rsync -e ssh -p 2222 -o StrictHostKeyChecking=no -o IdentitiesOnly=true -o UserKnownHostsFile=/dev/null -i 'E:/virtual-boxes/scotchbox/.vagrant/machines/default/virtualbox/private_key' --exclude .vagrant/ --exclude .git/ /e/virtual-boxes/scotchbox/ vagrant@127.0.0.1:/var/www
Error: Warning: Permanently added '[127.0.0.1]:2222' (ECDSA) to the list of known hosts.
dup() in/out/err failed
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(226) [sender=3.1.1]

I got the below errors once I run vagrant up and using rsync method in config type

There was an error when attempting to rsync a synced folder.
Please inspect the error message below for more info.

Host path: /e/virtual-boxes/scotchbox/
Guest path: /var/www
Command: rsync --verbose --archive --delete -z --copy-links --chmod=ugo=rwX --no-perms --no-owner --no-group --rsync-path sudo rsync -e ssh -p 2222 -o StrictHostKeyChecking=no -o IdentitiesOnly=true -o UserKnownHostsFile=/dev/null -i 'E:/virtual-boxes/scotchbox/.vagrant/machines/default/virtualbox/private_key' --exclude .vagrant/ --exclude .git/ /e/virtual-boxes/scotchbox/ vagrant@127.0.0.1:/var/www
Error: Warning: Permanently added '[127.0.0.1]:2222' (ECDSA) to the list of known hosts.
dup() in/out/err failed
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(226) [sender=3.1.1]

原文:https://stackoverflow.com/questions/36251364
更新时间:2022-09-14 15:09

最满意答案

经过很多痛苦之后,我决定不使用iFrame重新设计。 我认为iFrame是最好的方式然后意识到我错了,至少在我目前的理解水平上。 但是,使用此方法,我可以从fancyBox弹出窗口成功调用警报:

http://jsfiddle.net/nicorellius/d4KVs/

我想我也可以在这里使用我现有的验证。

这是更改的HTML:

<a href="#test" class="fancy-popup">fancy link</a>

我把HTML放在一个地方,并使用现有的fancyBox技术引用它。

但是,我并没有完全放弃。 我一直在摆弄它并找到了使用iFrame的解决方案。 不确定我做了什么,但我设置了原始计划,并使用了脚本:

    function alert_me() {
        $.fancybox.inner.find('iframe').contents().find(
            'input.click-me').click(function() {
                alert("fancybox has been foiled!!!");
        });
    }

现在,警报框在iFrame fancyBox中弹出。

这个问题的解决方案是:它可能仅限于我所在的同一个域,因此在生产中它可能无法工作。 我跑了一个快速测试,似乎跨域工作,但我觉得它将来会给我带来麻烦......


After a lot of pain, I decided to rework this without using an iFrame. I thought the iFrame was the best way to go but then realized I was wrong, at least at my current level of understanding. However, with this method, I can successfully call the alert from the fancyBox popup:

http://jsfiddle.net/nicorellius/d4KVs/

I think I can use my existing validation here too.

Here is HTML that changed:

<a href="#test" class="fancy-popup">fancy link</a>

I put the HTML in one place and referenced it using existing fancyBox techniques.

I didn't give up all the way, however. I kept on fiddling with it and found a solution using the iFrame. Not sure exactly what I did, but I set up original plan, and used the script:

    function alert_me() {
        $.fancybox.inner.find('iframe').contents().find(
            'input.click-me').click(function() {
                alert("fancybox has been foiled!!!");
        });
    }

and now the alert box pops up within the iFrame fancyBox.

The thing is with this solution is: it may be limited to the same domain I'm on, so in production it probably wont work. I ran a quick test and it seems to work cross domain but I have a feeling it'll cause me trouble in the future...

相关问答

更多
  • 我的方法是删除fancybox初始化并直接从共享函数中触发它: var share = { tw:function(title,url) { this.share('http://twitter.com/home?status=##URL##+##TITLE##',title,url); }, share:function(tpl,title,url) { if(!url) url = encodeURIComponent(window.location ...
  • 你可以做的是验证IF页面是否已经在fancybox中打开,并执行适当的fancybox方法,否则只需使用常规的javascript方法(即window.close() ) 话虽如此,在打开的页面中(通过window.open()或fancybox),你可能有一个函数来关闭它 function closePopup(){ window.close(); } 与关闭按钮/链接相关联 Close Window ...
  • 您必须手动打开Fancybox: $(document).ready(function() { $('.stesti').click(function(e) { e.preventDefault(); // prevents browser following the link var href = $(this).attr('href'); // save the url setTimeout(function(){ // Open Fancyb ...
  • 经过很多痛苦之后,我决定不使用iFrame重新设计。 我认为iFrame是最好的方式然后意识到我错了,至少在我目前的理解水平上。 但是,使用此方法,我可以从fancyBox弹出窗口成功调用警报: http://jsfiddle.net/nicorellius/d4KVs/ 我想我也可以在这里使用我现有的验证。 这是更改的HTML: fancy link 我把HTML放在一个地方,并使用现有的fancyBox技术引用它。 但是, ...
  • 我在您的网站上尝试过autoSize ,但似乎无法正常工作。 但是这段代码似乎可以解决问题: $(".fancybox").fancybox({ type: 'iframe', beforeShow: function(){ this.width = $('.fancybox-iframe').contents().find('div:first').width(); }, nextClick: false }); 我在这个答案中找到了它,并根据你的布局调整 ...
  • 从代码中删除此行。 'onClosed' : function() {alert("Successful!"); } 并在显式调用close函数时显示警报。 也许你可以创建这样的函数并调用parent.CloseFancyBox()而不是调用parent。$。fancybox.close() function CloseFancyBox() { $.fancybox.close(); alert("Successful"); } Remove this line from ...
  • 您正在寻找postMessage ,请阅读: https : //developer.mozilla.org/en-US/docs/Web/API/Window.postMessage 编辑:对不起,没有看到所有的评论说同样的事情 You are looking for postMessage, read up on that here: https://developer.mozilla.org/en-US/docs/Web/API/Window.postMessage Edit: sorry, didn ...
  • 也许原因是谷歌回归: X-Frame-Options:SAMEORIGIN 您可以在此规范中阅读有关它的信息: https://developer.mozilla.org/en-US/docs/HTTP/X-Frame-Options 如果我理解正确,当你收到X-Frame-Options:SAMEORIGIN时 ,你可以在IFrame中打开这个窗口,但只能在同一页面上。 Maybe the reason is google returns: X-Frame-Options: SAMEORIGIN you ...
  • 请试试这个,它为我做了诀窍: Please try this, it did the trick for me: