V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
raincious
V2EX  ›  Vagrant

那么,为什么用为什么这样启动在 PuPHPet 构建的 vagrant 虚拟机,然后失败了?

  •  
  •   raincious · 2015-04-18 13:55:15 +08:00 · 3354 次点击
    这是一个创建于 3296 天前的主题,其中的信息可能已经有所发展或是发生改变。

    好吧,已经知道Ruby的rubygems.org在大陆很慢很慢很慢了,所以替换成了淘宝家的ruby.taobao.org。

    具体就是在puphpet/shell/install-ruby.sh里,修改原先的:

    if [[ -f /.puphpet-stuff/install-ruby-1.9.3-p551 ]]; then
        exit 0
    fi
    

    if [[ -f /.puphpet-stuff/install-ruby-1.9.3-p551 ]]; then
        gem sources --remove https://rubygems.org/
    
        gem sources -a https://ruby.taobao.org/
    
        exit 0
    fi
    

    为了安全,我还在

    /usr/local/rvm/bin/rvm cleanup all
    

    下面加上了

    gem sources --remove https://rubygems.org/
    
    gem sources -a https://ruby.taobao.org/
    

    但是他们看起来并没有被执行。

    然后我就欢快的vagrant up了,box下载过程很顺利(事实上我两个box的下载都很顺利,但都up不起来,包括这个:(

    具体提示的问题如下:

    ==> default: stdin: is not a tty
    ==> default: https://rubygems.org/ removed from sources
    ==> default: https://ruby.taobao.org/ added to sources
    ==> default: Running provisioner: shell...
    default: Running: /tmp/vagrant-shell20150418-18582-urskzp.sh
    ==> default: stdin: is not a tty
    ==> default: ERROR: Could not find a valid gem 'deep_merge' (>= 0), here is why:
    ==> default: Unable to download data from https://ruby.taobao.org/ - no such name (https://ruby.taobao.org/specs.4.8.gz)
    ==> default: ERROR: Could not find a valid gem 'activesupport' (>= 0), here is why:
    ==> default: Unable to download data from https://ruby.taobao.org/ - no such name (https://ruby.taobao.org/specs.4.8.gz)
    ==> default: ERROR: Could not find a valid gem 'vine' (>= 0), here is why:
    ==> default: Unable to download data from https://ruby.taobao.org/ - no such name (https://ruby.taobao.org/specs.4.8.gz)
    ==> default: Running provisioner: puppet...
    ==> default: Running Puppet with site.pp...
    ==> default: stdin: is not a tty
    ==> default: Info: Loading facts in /tmp/vagrant-puppet/modules-0dbc21df9f28d2dcc14f24b7bc2688e7/concat/lib/facter/concat_basedir.rb

    后面不用看了……而且大家也都知道如果Ruby这套装不好的话,虚拟机里是什么都没有的。

    然后我vagrant ssh进了虚拟机,gem source -l看了下,虚拟机里的还是rubygems.org的源。

    然后:
    - 操作系统Fedora 21,虚拟机是 puphpet/ubuntu1404-x64
    - 虚拟机启动之后,网路是通的,我能用ssh进去wget。
    - 我换成了rubygems.org(也就是不改)之后,出现了一样的错误
    - Ruby 版本 1.9.3-p551
    - VirtualBox 4.3.26 r98988

    那么问题来了,为什么会这样且如何正确安装它呢?

    第 1 条附言  ·  2015-04-22 19:45:30 +08:00
    @vCleaner

    > set syntax_type = human
    > send 完全没有人回复我,<del>心好累</del>已经重新自己做镜像了,能删了么?
    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5240 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 09:17 · PVG 17:17 · LAX 02:17 · JFK 05:17
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.