質問編集履歴
1
vagrant fileの追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -57,3 +57,239 @@
|
|
57
57
|
|
58
58
|
|
59
59
|
よろしくお願いします。
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
###追記
|
64
|
+
|
65
|
+
destroyして見たんですけどうまくいきませんでした。
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
vagrant fileです。
|
70
|
+
|
71
|
+
```
|
72
|
+
|
73
|
+
# -*- mode: ruby -*-
|
74
|
+
|
75
|
+
# vi: set ft=ruby :
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
# All Vagrant configuration is done below. The "2" in Vagrant.configure
|
80
|
+
|
81
|
+
# configures the configuration version (we support older styles for
|
82
|
+
|
83
|
+
# backwards compatibility). Please don't change it unless you know what
|
84
|
+
|
85
|
+
# you're doing.
|
86
|
+
|
87
|
+
Vagrant.configure(2) do |config|
|
88
|
+
|
89
|
+
# The most common configuration options are documented and commented below.
|
90
|
+
|
91
|
+
# For a complete reference, please see the online documentation at
|
92
|
+
|
93
|
+
# https://docs.vagrantup.com.
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
# Every Vagrant development environment requires a box. You can search for
|
98
|
+
|
99
|
+
# boxes at https://atlas.hashicorp.com/search.
|
100
|
+
|
101
|
+
config.vm.box = "ubuntu/bionic64"
|
102
|
+
|
103
|
+
# Disable automatic box update checking. If you disable this, then
|
104
|
+
|
105
|
+
# boxes will only be checked for updates when the user runs
|
106
|
+
|
107
|
+
# `vagrant box outdated`. This is not recommended.
|
108
|
+
|
109
|
+
# config.vm.box_check_update = false
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
# Create a forwarded port mapping which allows access to a specific port
|
114
|
+
|
115
|
+
# within the machine from a port on the host machine. In the example below,
|
116
|
+
|
117
|
+
# accessing "localhost:8080" will access port 80 on the guest machine.
|
118
|
+
|
119
|
+
config.vm.network "forwarded_port", guest: 3000, host: 3000
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
# Create a private network, which allows host-only access to the machine
|
124
|
+
|
125
|
+
# using a specific IP.
|
126
|
+
|
127
|
+
config.vm.network "private_network", ip: "192.168.33.10"
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
# Create a public network, which generally matched to bridged network.
|
132
|
+
|
133
|
+
# Bridged networks make the machine appear as another physical device on
|
134
|
+
|
135
|
+
# your network.
|
136
|
+
|
137
|
+
# config.vm.network "public_network"
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
# Share an additional folder to the guest VM. The first argument is
|
142
|
+
|
143
|
+
# the path on the host to the actual folder. The second argument is
|
144
|
+
|
145
|
+
# the path on the guest to mount the folder. And the optional third
|
146
|
+
|
147
|
+
# argument is a set of non-required options.
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
# Provider-specific configuration so you can fine-tune various
|
154
|
+
|
155
|
+
# backing providers for Vagrant. These expose provider-specific options.
|
156
|
+
|
157
|
+
# Example for VirtualBox:
|
158
|
+
|
159
|
+
#
|
160
|
+
|
161
|
+
# config.vm.provider "virtualbox" do |vb|
|
162
|
+
|
163
|
+
# # Display the VirtualBox GUI when booting the machine
|
164
|
+
|
165
|
+
# vb.gui = true
|
166
|
+
|
167
|
+
#
|
168
|
+
|
169
|
+
# # Customize the amount of memory on the VM:
|
170
|
+
|
171
|
+
# vb.memory = "1024"
|
172
|
+
|
173
|
+
# end
|
174
|
+
|
175
|
+
#
|
176
|
+
|
177
|
+
# View the documentation for the provider you are using for more
|
178
|
+
|
179
|
+
# information on available options.
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
# Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
|
184
|
+
|
185
|
+
# such as FTP and Heroku are also available. See the documentation at
|
186
|
+
|
187
|
+
# https://docs.vagrantup.com/v2/push/atlas.html for more information.
|
188
|
+
|
189
|
+
# config.push.define "atlas" do |push|
|
190
|
+
|
191
|
+
# push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
|
192
|
+
|
193
|
+
# end
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
# Enable provisioning with a shell script. Additional provisioners such as
|
198
|
+
|
199
|
+
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
|
200
|
+
|
201
|
+
# documentation for more information about their specific syntax and use.
|
202
|
+
|
203
|
+
config.vm.provision "shell", inline: <<-SHELLSC
|
204
|
+
|
205
|
+
function install {
|
206
|
+
|
207
|
+
echo installing $1
|
208
|
+
|
209
|
+
shift
|
210
|
+
|
211
|
+
apt-get -y install "$@" >/dev/null 2>&1
|
212
|
+
|
213
|
+
}
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
echo updating package information
|
218
|
+
|
219
|
+
apt-add-repository -y ppa:brightbox/ruby-ng >/dev/null 2>&1
|
220
|
+
|
221
|
+
apt-get -y update >/dev/null 2>&1
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
install 'development tools' build-essential
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
install Ruby ruby2.5 ruby2.5-dev
|
230
|
+
|
231
|
+
update-alternatives --set ruby /usr/bin/ruby2.3 >/dev/null 2>&1
|
232
|
+
|
233
|
+
update-alternatives --set gem /usr/bin/gem2.3 >/dev/null 2>&1
|
234
|
+
|
235
|
+
echo installing Bundler
|
236
|
+
|
237
|
+
echo "gem: --no-ri --no-rdoc" > ~/.gemrc
|
238
|
+
|
239
|
+
gem install bundler -N >/dev/null 2>&1
|
240
|
+
|
241
|
+
install Git git
|
242
|
+
|
243
|
+
install SQLite sqlite3 libsqlite3-dev
|
244
|
+
|
245
|
+
install 'Nokogiri dependencies' libxml2 libxml2-dev libxslt1-dev zlib1g-dev
|
246
|
+
|
247
|
+
install 'ExecJS runtime' nodejs
|
248
|
+
|
249
|
+
echo 'Installing rails'
|
250
|
+
|
251
|
+
gem install rails
|
252
|
+
|
253
|
+
gem install railties
|
254
|
+
|
255
|
+
gem install listen
|
256
|
+
|
257
|
+
gem install puma
|
258
|
+
|
259
|
+
gem install sass
|
260
|
+
|
261
|
+
gem install tilt
|
262
|
+
|
263
|
+
gem install spring
|
264
|
+
|
265
|
+
gem install byebug
|
266
|
+
|
267
|
+
gem install chromedriver-helper
|
268
|
+
|
269
|
+
gem install sqlite3
|
270
|
+
|
271
|
+
gem install rest-client
|
272
|
+
|
273
|
+
update-locale LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 LC_ALL=en_US.UTF-8
|
274
|
+
|
275
|
+
echo 'You are now on Rails!'
|
276
|
+
|
277
|
+
echo ' o o o o o o o . . . ______________________________ _____=======_||____'
|
278
|
+
|
279
|
+
echo ' o _____ | | | |'
|
280
|
+
|
281
|
+
echo ' .][__n_n_|DD[ ====_____ | | | |'
|
282
|
+
|
283
|
+
echo ' >(________|__|_[_________]_|____________________________|_|_________________|'
|
284
|
+
|
285
|
+
echo ' _/oo OOOOO oo` ooo ooo `o!o!o o!o!o` `o!o o!o` '
|
286
|
+
|
287
|
+
echo ' -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-'
|
288
|
+
|
289
|
+
SHELLSC
|
290
|
+
|
291
|
+
end
|
292
|
+
|
293
|
+
|
294
|
+
|
295
|
+
```
|