流浪者中的 postgres(ubuntu14.04) [英] postgres in vagrant(ubuntu14.04)

查看:29
本文介绍了流浪者中的 postgres(ubuntu14.04)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用 vagrant 创建简单的开发环境,但在使用 postgres 时遇到了问题.

I tried to create simple dev environment with vagrant but fall in problem with postgres.

我的 Vagrantfile 很简单:

My Vagrantfile is simple:

# -*- mode: ruby -*-
# vi: set ft=ruby :

# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "ubuntu/trusty64"
  config.vm.network "forwarded_port", guest: 8000, host: 8000
  config.vm.network :public_network

  config.vm.provision "ansible" do |ansible|
    ansible.playbook = "playbook.yml"
  end
end

我使用 ansible 进行配置:

and I use ansible for provision:

- name: Configure development machine
  hosts: all
  sudo: True
  tasks:
    - name: install postgres
      apt: name={{ item }} update_cache=yes
      with_items:
        - postgresql 
        - postgresql-contrib

但是出了点问题并且 postgres 安装不正确

but something goes wrong and postgres installs incorrect

当我通过 ssh 连接到 VM 时,我看到了奇怪的事情:

When I ssh to VM and I see strange things:

 $ /etc/init.d/postgresql start
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LC_TIME = "uk_UA.UTF-8",
        LC_MONETARY = "uk_UA.UTF-8",
        LC_ADDRESS = "uk_UA.UTF-8",
        LC_TELEPHONE = "uk_UA.UTF-8",
        LC_NAME = "uk_UA.UTF-8",
        LC_MEASUREMENT = "uk_UA.UTF-8",
        LC_IDENTIFICATION = "uk_UA.UTF-8",
        LC_NUMERIC = "uk_UA.UTF-8",
        LC_PAPER = "uk_UA.UTF-8",
        LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
psql: could not connect to server: No such file or directory
        Is the server running locally and accepting

并且没有/etc/postgresql 目录(但存在/etc/postgresql-common)有什么想法吗?

and there is no /etc/postgresql directory(but /etc/postgresql-common is present) Any thoughts?

Github 存储库

推荐答案

在shell启动文件中加入以下几行

Add the following lines to shell startup file

LANGUAGE=en_US.UTF-8
LANG=en_US.UTF-8
LC_ALL=en_US.UTF-8

然后运行(以root权限)

And then run (with root privileges)

locale-gen en_US.UTF-8
dpkg-reconfigure locales

这篇关于流浪者中的 postgres(ubuntu14.04)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆