最后,在我的虚拟机中,我有旧版本的cabal,它带有 haskell-platform $ c $对我来说没有用处。但是,当我通过显式登录到虚拟机来单独执行这些命令时,并且不会将任何内容放入Vagrantfile中时,它会起作用,并且我得到cabal version 1.22.6.0,这是我需要的,但是使用Vagrantfile。 如何确保cabal未安装在根目录中?相反,我认为它应该安装在/ home / vagrant目录中,如下所示:/home/vagrant/.cabal/bin
==>默认:设置haskell-platform(2013.2.0.0.debian3)... ==>默认值:处理libc-bin(2.19-0ubuntu6.6)的触发器... ==>默认值:******************************** ==>默认:配置文件路径源是默认配置文件。 ==>默认:配置文件/root/.cabal/config找不到。 ==>默认:将默认配置写入/root/.cabal/config ==> default:从hackage.haskell下载最新的软件包列表 ==>默认值:******************************** ==>默认值:解决依赖关系... ==>默认:正在下载binary-0.7.6.1 ... ==>默认值:配置二进制-0.7.6.1 ... ==>默认值:构建二进制-0.7.6.1 ... ==>默认值:预处理流浪汉FILE低于库二进制0.7.6.1 ...
内容:
Vagrant.configure(2)do | config | config.vm.box = Ubuntu的/ trusty32 config.vm.box_check_update =假 config.vm.provider VirtualBox的 做| VB | vb.gui =真 vb.memory = 2048 端 config.vm.provision 壳,内联:其中;< - 壳 cd / home / vagrant sudo apt-get update echo-------------------------- --- echo----------------------------- sudo apt-get -y安装拉链 sudo易于得到-y安装的git sudo易于得到-y安装建立必要的 sudo易于得到-y安装libmakefile解析器-perl的 sudo易于-get -y install libreoffice-dev sudo apt-get -y install haskell-platform echo****************** ************** cabal update echo******************* ************* cabal install cabal-install echo+++++++++++ ====== ==== ++++ ===== #echoPATH = / home / vagrant / .cabal / bin:$ PATH>> /home/vagrant/.bashrc SHELL解决方案
我个人有更多的运气配置流浪汉,但如果你想这样做,你有没有尝试过:
sudo -u vagrant cabal install cabal-install
THe below is the content of the vagrant file. When I run vagrant up command, it installs cabal as required but it is in the root directory. Hence, it becomes unusable. I want to update the cabal version to latest version using cabal update. But it is not happening.
Finally, in my VM, I have old version of cabal which comes with haskell-platform which is of no use to me. However, when I execute these commands separately by explicitly logging into VM, and not putting anything in Vagrantfile, it works and I get cabal version 1.22.6.0 which is what I need, but by using Vagrantfile. How do I make sure that cabal is not getting installed in the root directory ? Instead I think it should get installed in the /home/vagrant directory like this: /home/vagrant/.cabal/bin
==> default: Setting up haskell-platform (2013.2.0.0.debian3) ... ==> default: Processing triggers for libc-bin (2.19-0ubuntu6.6) ... ==> default: ******************************** ==> default: Config file path source is default config file. ==> default: Config file /root/.cabal/config not found. ==> default: Writing default configuration to /root/.cabal/config ==> default: Downloading the latest package list from hackage.haskell ==> default: ******************************** ==> default: Resolving dependencies... ==> default: Downloading binary-0.7.6.1... ==> default: Configuring binary-0.7.6.1... ==> default: Building binary-0.7.6.1... ==> default: Preprocessing library binary-0.7.6.1...CONTENTS OF VAGRANT FILE BELOW:
Vagrant.configure(2) do |config| config.vm.box = "ubuntu/trusty32" config.vm.box_check_update = false config.vm.provider "virtualbox" do |vb| vb.gui = true vb.memory = "2048" end config.vm.provision "shell", inline: <<-SHELL cd /home/vagrant sudo apt-get update echo "-----------------------------" echo "-----------------------------" sudo apt-get -y install zip sudo apt-get -y install git sudo apt-get -y install build-essential sudo apt-get -y install libmakefile-parser-perl sudo apt-get -y install libreoffice-dev sudo apt-get -y install haskell-platform echo " ********************************" cabal update echo " ********************************" cabal install cabal-install echo "+++++++++++==========++++=====" # echo "PATH=/home/vagrant/.cabal/bin:$PATH" >> /home/vagrant/.bashrc SHELL解决方案
I've personally had more luck configuring vagrant with ansible, but if you wish to do it this way, have you tried:
sudo -u vagrant cabal install cabal-install
更多推荐
使用Vagrantfile将Cabal安装在根目录而不是/ home / vagrant目录中
发布评论