10
我創建了流浪實例,我每次嘗試在終端中執行psql
時都會收到此錯誤。請問如何解決?錯誤是說:psql:致命:角色「vagrant」不存在
PSQL:FATAL:角色「流浪漢」不存在
我以爲流浪漢注意到了這一問題?這是我的無業遊民文件:
Vagrant.require_plugin "vagrant-omnibus"
Vagrant.require_plugin "vagrant-berkshelf"
Vagrant.configure(2) do |config|
# Box config
config.vm.box = 'precise64'
config.vm.box_url = 'http://files.vagrantup.com/precise64.box'
# Plugin config
config.omnibus.chef_version = :latest
config.berkshelf.enabled = true
# Network config
config.vm.network :forwarded_port, guest: 3000, host: 3000
# Virtual config
config.vm.provider(:virtualbox) do |vb|
vb.customize [
"modifyvm", :id,
"--memory", "1024",
"--cpus", "4"
]
end
# Provisioner config
config.vm.provision :chef_solo do |chef|
chef.add_recipe 'apt'
chef.add_recipe 'postgresql::client'
chef.add_recipe 'postgresql::server'
chef.add_recipe 'build-essential'
chef.add_recipe 'rvm::system'
chef.add_recipe 'git'
chef.json = {
:postgresql => {
:version => '9.3'
},
"postgresql" => {
"password" => {
"postgres" => "kshgfi3ret3hihjfbkivtbo3ity835"
}
},
"database" => {
"create" => ["aisisplatform"]
},
:git => {
:prefix => "/usr/local"
},
:rvm => {
'rubies' => [ 'ruby-2.1.0' ],
'default_ruby' => 'ruby-2.1.0',
'vagrant' => {
:system_chef_solo => '/usr/bin/chef-solo'
}
},
}
end
end
什麼將創建在該Vagrantfile一個無業遊民的用戶是什麼樣子?我試過輸入'「password」=> {「vagrant」=>「kshgfi3ret3hihjfbkivtbo3ity835」},但它抱怨沒有「postgres」屬性。 – mcabrams
Mine看起來像這樣 'postgresql:{ 版本:「9.3」, 密碼:{postgres:「some_pass」}, database_name:「mobi_test」 },' – Anna