-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup_osx.html
More file actions
335 lines (231 loc) · 17.2 KB
/
setup_osx.html
File metadata and controls
335 lines (231 loc) · 17.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>OS X Setup — ClojureBridgeMN Documentation November 4-5, 2016 documentation</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="index" title="Index"
href="genindex.html"/>
<link rel="search" title="Search" href="search.html"/>
<link rel="top" title="ClojureBridgeMN Documentation November 4-5, 2016 documentation" href="index.html"/>
<link rel="up" title="Installfest" href="setup.html"/>
<link rel="next" title="Windows 7 Setup" href="setup_win7.html"/>
<link rel="prev" title="Github" href="github.html"/>
<script src="_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search">
<a href="index.html" class="icon icon-home"> ClojureBridgeMN Documentation
</a>
<div class="version">
Saturday Nov 5 2016 @ 15:59:08 futuro
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="setup.html">Installfest</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="setup.html#requirements">Requirements</a></li>
<li class="toctree-l2"><a class="reference internal" href="setup.html#code-of-conduct">Code of Conduct</a></li>
<li class="toctree-l2"><a class="reference internal" href="setup.html#what-we-are-installing">What we are installing</a></li>
<li class="toctree-l2"><a class="reference internal" href="setup.html#instructions-for-all">Instructions for all</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="setup.html#instructions-by-operating-system">Instructions by operating system</a><ul class="current">
<li class="toctree-l3 current"><a class="current reference internal" href="#">Mac OS X</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#starting-a-terminal">Starting a terminal</a></li>
<li class="toctree-l4"><a class="reference internal" href="#making-sure-java-is-installed">Making sure Java is installed</a></li>
<li class="toctree-l4"><a class="reference internal" href="#installing-leiningen">Installing Leiningen</a></li>
<li class="toctree-l4"><a class="reference internal" href="#getting-setup-with-heroku">Getting setup with Heroku</a></li>
<li class="toctree-l4"><a class="reference internal" href="#testing-your-setup">Testing your setup</a></li>
<li class="toctree-l4"><a class="reference internal" href="#try-the-koans">Try the koans</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="setup_win7.html">Windows 7</a></li>
<li class="toctree-l3"><a class="reference internal" href="setup_win8.html">Windows 8</a></li>
<li class="toctree-l3"><a class="reference internal" href="setup_win10.html">Windows 10</a></li>
<li class="toctree-l3"><a class="reference internal" href="setup_ubuntu.html">Linux</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to ClojureBridge</a></li>
<li class="toctree-l1"><a class="reference internal" href="track1.html">Track 1</a></li>
<li class="toctree-l1"><a class="reference internal" href="track2.html">Track 2</a></li>
<li class="toctree-l1"><a class="reference internal" href="resources.html">Clojure Resources</a></li>
<li class="toctree-l1"><a class="reference internal" href="community.html">Connect with the Clojure Community</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">ClojureBridgeMN Documentation</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html">Docs</a> »</li>
<li><a href="setup.html">Installfest</a> »</li>
<li>OS X Setup</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/setup_osx.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="os-x-setup">
<h1>OS X Setup<a class="headerlink" href="#os-x-setup" title="Permalink to this headline">¶</a></h1>
<ul class="simple">
<li><a class="reference external" href="#starting-a-terminal">Start a terminal</a></li>
<li><a class="reference external" href="#making-sure-java-is-installed">Make sure Java is installed</a></li>
<li><a class="reference external" href="#installing-leiningen">Get Leiningen installed</a></li>
<li><a class="reference external" href="#getting-setup-with-heroku">Get Heroku installed (includes Git)</a></li>
<li><a class="reference external" href="#testing-your-setup">Test installation</a></li>
</ul>
<div class="section" id="starting-a-terminal">
<h2>Starting a terminal<a class="headerlink" href="#starting-a-terminal" title="Permalink to this headline">¶</a></h2>
<p>For these instructions, and for much of the class, you will need to have a terminal, or command line, open. This is a text-based interface to talk to your computer, and you can open it by running Terminal.app, which is found under <code class="docutils literal"><span class="pre">/Applications/Utilities</span></code>. If you have never used the terminal before, you may want to spend some time <a class="reference external" href="http://blog.teamtreehouse.com/command-line-basics">reading up on command-line basics</a>.</p>
<p>Go ahead and open your terminal now. It should look something like this:</p>
<p><img alt="blank terminal" src="_images/blank_terminal.png" /></p>
<p>The prompt (where you will type your commands) may look different: it usually shows the computer name and user name, as well as the folder or directory you are currently in.</p>
<p>For the rest of this setup, I will tell you to run commands in your terminal. When I say that, I mean “type the command into the terminal and press the Return key.”</p>
</div>
<div class="section" id="making-sure-java-is-installed">
<h2>Making sure Java is installed<a class="headerlink" href="#making-sure-java-is-installed" title="Permalink to this headline">¶</a></h2>
<p>Run <code class="docutils literal"><span class="pre">java</span> <span class="pre">-version</span></code> in your terminal.</p>
<p>If Java is installed, you will see something like this in your terminal:</p>
<p><img alt="Java version" src="_images/java_version.png" /></p>
<p>If Java is not installed, or the version number is less than 1.8 you can download it here <a class="reference external" href="http://www.oracle.com/technetwork/java/javase/downloads/index.html">Java Downloads</a></p>
<p><img alt="Java download 1" src="_images/java-download11.png" /></p>
<p>Click the Java download button.</p>
<p><img alt="Java download 2" src="_images/java-download21.png" /></p>
<p>Accept the license agreement, and download the version for Mac OS X.</p>
<p>Double-click the jdk-8u111-macosx-x64.dmg file in your Downloads directory and walk through the installer.</p>
<p><img alt="Java download 1" src="_images/java-installer1.png" /></p>
</div>
<div class="section" id="installing-leiningen">
<h2>Installing Leiningen<a class="headerlink" href="#installing-leiningen" title="Permalink to this headline">¶</a></h2>
<p>Leiningen is a tool used on the command line to manage Clojure projects.</p>
<p>To install <code class="docutils literal"><span class="pre">lein</span></code>, execute the following commands in your terminal. You will be prompted to enter your password.</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>curl https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein > lein
sudo mkdir -p /usr/local/bin/
sudo mv lein /usr/local/bin/lein
sudo chmod a+x /usr/local/bin/lein
<span class="nb">cd</span> <span class="nv">$HOME</span>
<span class="nb">echo</span> <span class="s1">'PATH=$PATH:/usr/local/bin'</span> >> .bashrc
<span class="nb">source</span> .bashrc
</pre></div>
</div>
<p>After you run the above commands, run the <code class="docutils literal"><span class="pre">lein</span> <span class="pre">version</span></code> command. It should take a while to run, as it will download some resources it needs the first time. If it completes successfully, you are golden! If not, ask an instructor for help.</p>
</div>
<div class="section" id="getting-setup-with-heroku">
<h2>Getting setup with Heroku<a class="headerlink" href="#getting-setup-with-heroku" title="Permalink to this headline">¶</a></h2>
<p>Heroku is the tool we will use in order to put your application online where others can see it.</p>
<p>First, we need to create an account. Go to <a class="reference external" href="http://heroku.com">Heroku</a> and click the “Sign up” link.</p>
<p><img alt="Heroku step 1" src="_images/heroku-step1.png" /></p>
<p>You will be taken to a form where you can create an account. Fill out that form, and you will be sent an email with a link to click to continue the signup process.</p>
<p><img alt="Heroku step 2" src="_images/heroku-step2.png" /></p>
<p>After clicking on the link, you will be taken to another form where you will need to choose a password. Choose one and enter it twice.</p>
<p><img alt="Heroku step 3" src="_images/heroku-step3.png" /></p>
<p>After all that, go <a class="reference external" href="https://devcenter.heroku.com/articles/getting-started-with-clojure#set-up">here</a> and click “Download Heroku Toolbelt for Mac OS X”.</p>
<p><img alt="Heroku dashboard" src="_images/heroku-getting-started.png" /></p>
<p>If you do not see this link, you can download the toolbelt from <a class="reference external" href="https://toolbelt.heroku.com/">toolbelt.heroku.com</a>.</p>
<p>This will download a .pkg file. Double-click it to install the Heroku Toolbelt and follow all prompts from the installation wizard. You will need your OS X account password to complete installation. If you are prompted to create an SSH key, say yes. It may also prompt you to install git. Once the Heroku Toolbelt is installed, go to your terminal and run the command <code class="docutils literal"><span class="pre">heroku</span> <span class="pre">login</span></code>. You will be prompted for your email and password on Heroku. If you enter them and the command ends successfully, congratulations!</p>
</div>
<div class="section" id="testing-your-setup">
<h2>Testing your setup<a class="headerlink" href="#testing-your-setup" title="Permalink to this headline">¶</a></h2>
<p>You have set up Java, Leiningen, Atom, Git, and Heroku on your computer–all the tools you will need for this course. Before starting, we need to test them out.</p>
<p>Go to your terminal and run the following command:</p>
<div class="highlight-none"><div class="highlight"><pre><span></span>git clone https://github.com/heroku/clojure-sample.git
</pre></div>
</div>
<p>This will check out a sample Clojure application from GitHub, a central repository for lots of source code. Your terminal should look similar to this picture:</p>
<p><img alt="Testing git clone" src="_images/testing-step1.png" /></p>
<p>Then run the command:</p>
<div class="highlight-none"><div class="highlight"><pre><span></span>cd clojure-sample
</pre></div>
</div>
<p>This will put you in the directory with the source code for this sample bit of Clojure code. After that completes, run:</p>
<div class="highlight-none"><div class="highlight"><pre><span></span>lein repl
</pre></div>
</div>
<p>This could take a long time, and will download many other pieces of code it relies on. You should see lines that start with <code class="docutils literal"><span class="pre">Retrieving</span> <span class="pre">...</span></code> on your screen. When it finishes, your terminal should look like the following:</p>
<p><img alt="Testing lein repl" src="_images/testing-step2.png" /></p>
<p>This is starting a REPL, which we will learn about soon. It’s a special terminal for Clojure. At the REPL prompt, type <code class="docutils literal"><span class="pre">(+</span> <span class="pre">1</span> <span class="pre">1)</span></code> and press Return. Did you get the answer <code class="docutils literal"><span class="pre">2</span></code> back? You will learn more about that in the course.</p>
<p>For now, enter <code class="docutils literal"><span class="pre">(quit)</span></code> to quit the REPL. <em>(NOTE: you can also type <code class="docutils literal"><span class="pre">(exit)</span></code> or press the Control button and D button on your keyboard together)</em>.
This should take you out of the Clojure REPL and back to your normal terminal prompt.</p>
<p>You should still be in the <code class="docutils literal"><span class="pre">clojure-sample</span></code> directory.</p>
<p>Run this command:</p>
<p><code class="docutils literal"><span class="pre">heroku</span> <span class="pre">create</span></code></p>
<p>There should be output about something being created. A URL will be displayed. Look at the following example:</p>
<p><img alt="Testing heroku create" src="_images/testing-step5.png" /></p>
<p>Next, run the following commands:</p>
<div class="highlight-none"><div class="highlight"><pre><span></span>git push heroku master
heroku open
</pre></div>
</div>
<p>Enter “yes” if you are asked if you are sure you want to connect, like in the following image:</p>
<p><img alt="Connecting via SSH" src="_images/testing-step6.png" /></p>
<p>Your browser should open (and take a long time to load), and you should see a website like the following:</p>
<p><img alt="Testing heroku working" src="_images/testing-step7.png" /></p>
<p>If your browser does not open after running <code class="docutils literal"><span class="pre">heroku</span> <span class="pre">open</span></code>, start a browser and go to the URL displayed after you ran <code class="docutils literal"><span class="pre">heroku</span> <span class="pre">create</span></code>.</p>
<p>Congratulations! That website is running code you have on your computer that you have uploaded. You have actually made a very simple Clojure app, and your computer is all set up to make more.</p>
</div>
<div class="section" id="try-the-koans">
<h2>Try the koans<a class="headerlink" href="#try-the-koans" title="Permalink to this headline">¶</a></h2>
<p>If you’re a track 2 student, try to tackle running the <a class="reference internal" href="koans.html"><span class="doc">koans</span></a>.</p>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="setup_win7.html" class="btn btn-neutral float-right" title="Windows 7 Setup" accesskey="n">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="github.html" class="btn btn-neutral" title="Github" accesskey="p"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
© Copyright 2016 ClojureBridgeMN volunteers.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'November 4-5, 2016',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>