2
ホームステッドの仕組みを誤解していると思います。私はper project installationが欲しいが、何か変わったことが起きた。私の手順は次のとおりです。Laravel 5.2:ホームステイプロビジョニングは、再インストール後にデータベースが既に存在するエラーを返します
- vagrantbox(vagrant up)を実行します。データベースホームステッドが作成されます。 Up &が実行中です。
- 迷惑メールボックス(迷惑メール停止)を停止します。
- ボックスをVirtualBoxクライアントから削除します。
- 迷惑な人をもう一度実行してください。もちろん、ボックスをダウンロードする必要があります。 "アップ" プロセス中
、私はエラーを取得する:
CREATEDB:データベースの作成に失敗しました:ERROR:データベース "ホームステッド" すでに
が存在するどのようにそれは可能ですか?迷惑行為は、ホストマシンのどこかでデータベースを作成し、別のインストールに再利用しますか?
私のホストはMac OS Xマシン(El Capitan)です。
require 'json'
require 'yaml'
VAGRANTFILE_API_VERSION ||= "2"
confDir = $confDir ||= File.expand_path("vendor/laravel/homestead", File.dirname(__FILE__))
homesteadYamlPath = "Homestead.yaml"
homesteadJsonPath = "Homestead.json"
afterScriptPath = "after.sh"
aliasesPath = "aliases"
require File.expand_path(confDir + '/scripts/homestead.rb')
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
if File.exists? aliasesPath then
config.vm.provision "file", source: aliasesPath, destination: "~/.bash_aliases"
end
if File.exists? homesteadYamlPath then
Homestead.configure(config, YAML::load(File.read(homesteadYamlPath)))
elsif File.exists? homesteadJsonPath then
Homestead.configure(config, JSON.parse(File.read(homesteadJsonPath)))
end
if File.exists? afterScriptPath then
config.vm.provision "shell", path: afterScriptPath
end
end
そして、私のHomestead.yaml
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
hostname: laraveltest
name: laraveltest
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: "/Users/jorge/Dev/laraveltest"
to: "/home/vagrant/laraveltest"
sites:
- map: homestead.app
to: "/home/vagrant/laraveltest/public"
databases:
- homestead
# blackfire:
# - id: foo
# token: bar
# client-id: foo
# client-token: bar
# ports:
# - send: 50000
# to: 5000
# - send: 7777
# to: 777
# protocol: udp
私は同じ問題を抱えているので、答えを楽しみにしています。 – Gunnar