質問するログイン新規登録

質問編集履歴

1

追記

2019/02/14 09:12

投稿

Gr.
Gr.

スコア89

title CHANGED
File without changes
body CHANGED
@@ -98,4 +98,118 @@
98
98
  default via 10.0.2.2 dev eth0
99
99
  10.0.2.0/24 dev eth0 proto kernel scope link src 10.0.2.15
100
100
  192.168.33.0/24 dev eth1 proto kernel scope link src 192.168.33.10
101
+ ```
102
+
103
+ ### 追記
104
+ ```Vagrantfile
105
+ # -*- mode: ruby -*-
106
+ # vi: set ft=ruby :
107
+
108
+ # All Vagrant configuration is done below. The "2" in Vagrant.configure
109
+ # configures the configuration version (we support older styles for
110
+ # backwards compatibility). Please don't change it unless you know what
111
+ # you're doing.
112
+ Vagrant.configure(2) do |config|
113
+ # The most common configuration options are documented and commented below.
114
+ # For a complete reference, please see the online documentation at
115
+ # https://docs.vagrantup.com.
116
+
117
+ # Every Vagrant development environment requires a box. You can search for
118
+ # boxes at https://atlas.hashicorp.com/search.
119
+ config.vm.box = "ubuntu/trusty32"
120
+ # Disable automatic box update checking. If you disable this, then
121
+ # boxes will only be checked for updates when the user runs
122
+ # `vagrant box outdated`. This is not recommended.
123
+ # config.vm.box_check_update = false
124
+
125
+ # Create a forwarded port mapping which allows access to a specific port
126
+ # within the machine from a port on the host machine. In the example below,
127
+ # accessing "localhost:8080" will access port 80 on the guest machine.
128
+ config.vm.network "forwarded_port", guest: 3000, host: 3000
129
+
130
+ # Create a private network, which allows host-only access to the machine
131
+ # using a specific IP.
132
+ config.vm.network "private_network", ip: "192.168.33.10"
133
+
134
+ # Create a public network, which generally matched to bridged network.
135
+ # Bridged networks make the machine appear as another physical device on
136
+ # your network.
137
+ # config.vm.network "public_network"
138
+
139
+ # Share an additional folder to the guest VM. The first argument is
140
+ # the path on the host to the actual folder. The second argument is
141
+ # the path on the guest to mount the folder. And the optional third
142
+ # argument is a set of non-required options.
143
+ config.vm.synced_folder "./", "/home/vagrant"
144
+
145
+ # Provider-specific configuration so you can fine-tune various
146
+ # backing providers for Vagrant. These expose provider-specific options.
147
+ # Example for VirtualBox:
148
+ #
149
+ # config.vm.provider "virtualbox" do |vb|
150
+ # # Display the VirtualBox GUI when booting the machine
151
+ # vb.gui = true
152
+ #
153
+ # # Customize the amount of memory on the VM:
154
+ # vb.memory = "1024"
155
+ # end
156
+ #
157
+ # View the documentation for the provider you are using for more
158
+ # information on available options.
159
+
160
+ # Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
161
+ # such as FTP and Heroku are also available. See the documentation at
162
+ # https://docs.vagrantup.com/v2/push/atlas.html for more information.
163
+ # config.push.define "atlas" do |push|
164
+ # push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
165
+ # end
166
+
167
+ # Enable provisioning with a shell script. Additional provisioners such as
168
+ # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
169
+ # documentation for more information about their specific syntax and use.
170
+ config.vm.provision "shell", inline: <<-SHELLSC
171
+ function install {
172
+ echo installing $1
173
+ shift
174
+ apt-get -y install "$@" >/dev/null 2>&1
175
+ }
176
+
177
+ echo updating package information
178
+ apt-add-repository -y ppa:brightbox/ruby-ng >/dev/null 2>&1
179
+ apt-get -y update >/dev/null 2>&1
180
+
181
+ install 'development tools' build-essential
182
+
183
+ install Ruby ruby2.3 ruby2.3-dev
184
+ update-alternatives --set ruby /usr/bin/ruby2.3 >/dev/null 2>&1
185
+ update-alternatives --set gem /usr/bin/gem2.3 >/dev/null 2>&1
186
+ echo installing Bundler
187
+ echo "gem: --no-ri --no-rdoc" > ~/.gemrc
188
+ gem install bundler -N >/dev/null 2>&1
189
+ install Git git
190
+ install SQLite sqlite3 libsqlite3-dev
191
+ install 'Nokogiri dependencies' libxml2 libxml2-dev libxslt1-dev zlib1g-dev
192
+ install 'ExecJS runtime' nodejs
193
+ echo 'Installing rails'
194
+ gem install rails -v '5.1.5'
195
+ gem install railties
196
+ gem install listen
197
+ gem install puma
198
+ gem install sass
199
+ gem install tilt
200
+ gem install spring
201
+ gem install byebug
202
+ gem install chromedriver-helper
203
+ gem install sqlite3
204
+ update-locale LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 LC_ALL=en_US.UTF-8
205
+ echo 'You are now on Rails!'
206
+ echo ' o o o o o o o . . . ______________________________ _____=======_||____'
207
+ echo ' o _____ | | | |'
208
+ echo ' .][__n_n_|DD[ ====_____ | | | |'
209
+ echo ' >(________|__|_[_________]_|____________________________|_|_________________|'
210
+ echo ' _/oo OOOOO oo` ooo ooo `o!o!o o!o!o` `o!o o!o` '
211
+ echo ' -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-'
212
+ SHELLSC
213
+ end
214
+
101
215
  ```