回答編集履歴
1
追記
test
CHANGED
@@ -1 +1,99 @@
|
|
1
1
|
修正後となってるVagrantfileを再度`/home/ubuntu`で検索して`~`に置換するとよいです
|
2
|
+
|
3
|
+
|
4
|
+
|
5
|
+
|
6
|
+
|
7
|
+
**追記**
|
8
|
+
|
9
|
+
|
10
|
+
|
11
|
+
とりあえず、provisionに成功するようにだけしたものは以下です。
|
12
|
+
|
13
|
+
**注:** 一度`vagrant up`に失敗した場合は、`vagrant destroy`でイメージを破棄しないと失敗し続けます。
|
14
|
+
|
15
|
+
また、コメントでも指摘した通りいくつかの問題がありrailsを使うことは実質不可能かと思います。
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
```vagrantfile
|
20
|
+
|
21
|
+
# -*- mode: ruby -*-
|
22
|
+
|
23
|
+
# vi: set ft=ruby :
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
Vagrant.configure("2") do |config|
|
28
|
+
|
29
|
+
config.vm.box = "ubuntu/xenial64"
|
30
|
+
|
31
|
+
config.vm.network :"forwarded_port", guest: 3000, host: 3000
|
32
|
+
|
33
|
+
config.vm.synced_folder "~/workspace", "/home/vagrant/workspace", :create => true, mount_options: ['dmode=777','fmode=755']
|
34
|
+
|
35
|
+
config.vm.provision "shell", privileged: false, inline: <<-SHELL
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
sudo apt-get -y upgrade
|
40
|
+
|
41
|
+
sudo apt-get -y update
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
# install essentials
|
46
|
+
|
47
|
+
sudo apt-get install git curl g++ make vim nodejs libreadline-dev libssl-dev zlib1g-dev imagemagick libmagickcore-dev libmagickwand-dev libsqlite3-dev -y
|
48
|
+
|
49
|
+
sudo apt-get remove ruby -y
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
# get rbenv and set path
|
54
|
+
|
55
|
+
git clone git://github.com/rbenv/rbenv.git ~.rbenv
|
56
|
+
|
57
|
+
echo 'export PATH="~.rbenv/bin:$PATH"' >> ~/.profile
|
58
|
+
|
59
|
+
echo 'eval "$(rbenv init -)"' >> ~/.profile
|
60
|
+
|
61
|
+
. /home/vagrant/.profile
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
# install ruby-build
|
66
|
+
|
67
|
+
mkdir -p ~/.rbenv/plugins
|
68
|
+
|
69
|
+
git clone git://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
# install ruby
|
74
|
+
|
75
|
+
rbenv install 2.3.0
|
76
|
+
|
77
|
+
rbenv global 2.3.0
|
78
|
+
|
79
|
+
rbenv rehash
|
80
|
+
|
81
|
+
sudo apt-get install ruby-railties -y
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
# install bundle
|
86
|
+
|
87
|
+
gem install bundler --no-document
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
# install postgresql
|
92
|
+
|
93
|
+
sudo apt-get install postgresql postgresql-contrib python-psycopg2 libpq-dev -y
|
94
|
+
|
95
|
+
SHELL
|
96
|
+
|
97
|
+
end
|
98
|
+
|
99
|
+
```
|