浏览代码

vagrant: fix install_pyenv

same code as in master now.
Thomas Waldmann 4 年之前
父节点
当前提交
7c03ca5f76
共有 1 个文件被更改,包括 8 次插入6 次删除
  1. 8 6
      Vagrantfile

+ 8 - 6
Vagrantfile

@@ -199,14 +199,16 @@ def install_cygwin_venv
 end
 end
 
 
 def install_pyenv(boxname)
 def install_pyenv(boxname)
-  script = <<-EOF
-    curl -s -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash
-    echo 'export PATH="$HOME/.pyenv/bin:$PATH"' >> ~/.bash_profile
-    echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
-    echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bash_profile
+  return <<-EOF
     echo 'export PYTHON_CONFIGURE_OPTS="--enable-shared"' >> ~/.bash_profile
     echo 'export PYTHON_CONFIGURE_OPTS="--enable-shared"' >> ~/.bash_profile
+    echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
+    echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
+    . ~/.bash_profile
+    curl -s -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash
+    echo 'eval "$(pyenv init --path)"' >> ~/.bash_profile
+    echo 'eval "$(pyenv init -)"' >> ~/.bashrc
+    echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc
   EOF
   EOF
-  return script
 end
 end
 
 
 def fix_pyenv_darwin(boxname)
 def fix_pyenv_darwin(boxname)