質問編集履歴

1

追記

2019/02/14 09:12

投稿

Gr.
Gr.

スコア89

test CHANGED
File without changes
test CHANGED
@@ -199,3 +199,231 @@
199
199
  192.168.33.0/24 dev eth1 proto kernel scope link src 192.168.33.10
200
200
 
201
201
  ```
202
+
203
+
204
+
205
+ ### 追記
206
+
207
+ ```Vagrantfile
208
+
209
+ # -*- mode: ruby -*-
210
+
211
+ # vi: set ft=ruby :
212
+
213
+
214
+
215
+ # All Vagrant configuration is done below. The "2" in Vagrant.configure
216
+
217
+ # configures the configuration version (we support older styles for
218
+
219
+ # backwards compatibility). Please don't change it unless you know what
220
+
221
+ # you're doing.
222
+
223
+ Vagrant.configure(2) do |config|
224
+
225
+ # The most common configuration options are documented and commented below.
226
+
227
+ # For a complete reference, please see the online documentation at
228
+
229
+ # https://docs.vagrantup.com.
230
+
231
+
232
+
233
+ # Every Vagrant development environment requires a box. You can search for
234
+
235
+ # boxes at https://atlas.hashicorp.com/search.
236
+
237
+ config.vm.box = "ubuntu/trusty32"
238
+
239
+ # Disable automatic box update checking. If you disable this, then
240
+
241
+ # boxes will only be checked for updates when the user runs
242
+
243
+ # `vagrant box outdated`. This is not recommended.
244
+
245
+ # config.vm.box_check_update = false
246
+
247
+
248
+
249
+ # Create a forwarded port mapping which allows access to a specific port
250
+
251
+ # within the machine from a port on the host machine. In the example below,
252
+
253
+ # accessing "localhost:8080" will access port 80 on the guest machine.
254
+
255
+ config.vm.network "forwarded_port", guest: 3000, host: 3000
256
+
257
+
258
+
259
+ # Create a private network, which allows host-only access to the machine
260
+
261
+ # using a specific IP.
262
+
263
+ config.vm.network "private_network", ip: "192.168.33.10"
264
+
265
+
266
+
267
+ # Create a public network, which generally matched to bridged network.
268
+
269
+ # Bridged networks make the machine appear as another physical device on
270
+
271
+ # your network.
272
+
273
+ # config.vm.network "public_network"
274
+
275
+
276
+
277
+ # Share an additional folder to the guest VM. The first argument is
278
+
279
+ # the path on the host to the actual folder. The second argument is
280
+
281
+ # the path on the guest to mount the folder. And the optional third
282
+
283
+ # argument is a set of non-required options.
284
+
285
+ config.vm.synced_folder "./", "/home/vagrant"
286
+
287
+
288
+
289
+ # Provider-specific configuration so you can fine-tune various
290
+
291
+ # backing providers for Vagrant. These expose provider-specific options.
292
+
293
+ # Example for VirtualBox:
294
+
295
+ #
296
+
297
+ # config.vm.provider "virtualbox" do |vb|
298
+
299
+ # # Display the VirtualBox GUI when booting the machine
300
+
301
+ # vb.gui = true
302
+
303
+ #
304
+
305
+ # # Customize the amount of memory on the VM:
306
+
307
+ # vb.memory = "1024"
308
+
309
+ # end
310
+
311
+ #
312
+
313
+ # View the documentation for the provider you are using for more
314
+
315
+ # information on available options.
316
+
317
+
318
+
319
+ # Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
320
+
321
+ # such as FTP and Heroku are also available. See the documentation at
322
+
323
+ # https://docs.vagrantup.com/v2/push/atlas.html for more information.
324
+
325
+ # config.push.define "atlas" do |push|
326
+
327
+ # push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
328
+
329
+ # end
330
+
331
+
332
+
333
+ # Enable provisioning with a shell script. Additional provisioners such as
334
+
335
+ # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
336
+
337
+ # documentation for more information about their specific syntax and use.
338
+
339
+ config.vm.provision "shell", inline: <<-SHELLSC
340
+
341
+ function install {
342
+
343
+ echo installing $1
344
+
345
+ shift
346
+
347
+ apt-get -y install "$@" >/dev/null 2>&1
348
+
349
+ }
350
+
351
+
352
+
353
+ echo updating package information
354
+
355
+ apt-add-repository -y ppa:brightbox/ruby-ng >/dev/null 2>&1
356
+
357
+ apt-get -y update >/dev/null 2>&1
358
+
359
+
360
+
361
+ install 'development tools' build-essential
362
+
363
+
364
+
365
+ install Ruby ruby2.3 ruby2.3-dev
366
+
367
+ update-alternatives --set ruby /usr/bin/ruby2.3 >/dev/null 2>&1
368
+
369
+ update-alternatives --set gem /usr/bin/gem2.3 >/dev/null 2>&1
370
+
371
+ echo installing Bundler
372
+
373
+ echo "gem: --no-ri --no-rdoc" > ~/.gemrc
374
+
375
+ gem install bundler -N >/dev/null 2>&1
376
+
377
+ install Git git
378
+
379
+ install SQLite sqlite3 libsqlite3-dev
380
+
381
+ install 'Nokogiri dependencies' libxml2 libxml2-dev libxslt1-dev zlib1g-dev
382
+
383
+ install 'ExecJS runtime' nodejs
384
+
385
+ echo 'Installing rails'
386
+
387
+ gem install rails -v '5.1.5'
388
+
389
+ gem install railties
390
+
391
+ gem install listen
392
+
393
+ gem install puma
394
+
395
+ gem install sass
396
+
397
+ gem install tilt
398
+
399
+ gem install spring
400
+
401
+ gem install byebug
402
+
403
+ gem install chromedriver-helper
404
+
405
+ gem install sqlite3
406
+
407
+ update-locale LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 LC_ALL=en_US.UTF-8
408
+
409
+ echo 'You are now on Rails!'
410
+
411
+ echo ' o o o o o o o . . . ______________________________ _____=======_||____'
412
+
413
+ echo ' o _____ | | | |'
414
+
415
+ echo ' .][__n_n_|DD[ ====_____ | | | |'
416
+
417
+ echo ' >(________|__|_[_________]_|____________________________|_|_________________|'
418
+
419
+ echo ' _/oo OOOOO oo` ooo ooo `o!o!o o!o!o` `o!o o!o` '
420
+
421
+ echo ' -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-'
422
+
423
+ SHELLSC
424
+
425
+ end
426
+
427
+
428
+
429
+ ```