-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
407 lines (259 loc) · 17.2 KB
/
index.html
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
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
<!DOCTYPE html>
<!--[if IEMobile 7 ]><html class="no-js iem7"><![endif]-->
<!--[if lt IE 9]><html class="no-js lte-ie8"><![endif]-->
<!--[if (gt IE 8)|(gt IEMobile 7)|!(IEMobile)|!(IE)]><!--><html class="no-js" lang="en"><!--<![endif]-->
<head>
<meta charset="utf-8">
<title>Raymond on Everything</title>
<meta name="author" content="Raymond Maung">
<meta name="description" content="Having been using rails development on Mac book natively, I’ve been wanting to do rails development on Windows-based Desktop. But, anyone …">
<!-- http://t.co/dKP3o1e -->
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="canonical" href="http://raymaung.github.io">
<link href="/favicon.png" rel="icon">
<link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet" type="text/css">
<link href="/atom.xml" rel="alternate" title="Raymond on Everything" type="application/atom+xml">
<script src="/javascripts/modernizr-2.0.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>!window.jQuery && document.write(unescape('%3Cscript src="./javascripts/lib/jquery.min.js"%3E%3C/script%3E'))</script>
<script src="/javascripts/octopress.js" type="text/javascript"></script>
<!--Fonts from Google"s Web font directory at http://google.com/webfonts -->
<link href="http://fonts.googleapis.com/css?family=PT+Serif:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">
<link href="http://fonts.googleapis.com/css?family=PT+Sans:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">
</head>
<body >
<header role="banner"><hgroup>
<h1><a href="/">Raymond on Everything</a></h1>
<h2>More on learning and less on storing</h2>
</hgroup>
</header>
<nav role="navigation"><ul class="subscription" data-subscription="rss">
<li><a href="/atom.xml" rel="subscribe-rss" title="subscribe via RSS">RSS</a></li>
</ul>
<form action="http://google.com/search" method="get">
<fieldset role="search">
<input type="hidden" name="q" value="site:raymaung.github.io" />
<input class="search" type="text" name="q" results="0" placeholder="Search"/>
</fieldset>
</form>
<ul class="main-navigation">
<li><a href="/">Blog</a></li>
<li><a href="/blog/archives">Archives</a></li>
</ul>
</nav>
<div id="main">
<div id="content">
<div class="blog-index">
<article>
<header>
<h1 class="entry-title"><a href="/blog/2013/04/29/vagrant-for-rails-application-development/">Vagrant for Rails Application Development</a></h1>
<p class="meta">
<time datetime="2013-04-29T08:15:00+10:00" pubdate data-updated="true">Apr 29<span>th</span>, 2013</time>
</p>
</header>
<div class="entry-content"><p>Having been using rails development on Mac book natively, I’ve been wanting to do rails development on Windows-based Desktop. But, anyone trying to set up Rails development environment on Windows is a pain and it is not really worth it, given the production will be running on *nix environment. I find the attempt just silly; I admit it was a good exercise but just a waste of time.</p>
<p>I’ve experimented a bit with Vagrant in 2010, but never really attempt to integrate it as part of my normaly daily life. Now in 2013, I thought it is time to start using Vagrant seriously and it will not ony allowing me to develop Rails on Windows Desktop also, it will help me keep the Mac box clean.</p>
<p>Here are the attempts just hoping to <em>work</em> but like any piece of software, nothing works as expected.</p>
<h2>rails-dev-box</h2>
<p>First attempt, <em><a href="https://github.com/rails/rails-dev-box">rails-dev-box</a></em>, it is called <em>rails-dev-box</em>, it sounds like a box for Rails developer - <em>application</em> that is. It seems to work fine with setting up db, libs and packages. After getting stuck with trying to configure Postgre for a few hours, (confession, I am not very well versed with *nix command lines and not very familiar with Postres set up in general), I eventualy realize the box is for Rails <strong>core</strong> development, not <strong>application</strong>.</p>
<p>While, other have success with using as application development, I just decided not to spend any more time on it.</p>
<h3>Isssues I run into</h3>
<ul>
<li>PostreSql
<ul>
<li><p>finding <code>pg_ctl</code></p>
<ul>
<li>path not in the <code>$PATH</code></li>
<li>should add <code>PATH=$PATH:/usr/lib/postgresql/9.1/bin</code> to <code>.bashrc</code></li>
</ul>
</li>
<li><p>initializing database</p>
<ul>
<li><code>sudo -u postgres initdb /usr/local/var/postgres</code></li>
<li>permission issues at <code>/usr/local/var/postgres</code>
<ul>
<li>need to give <em>postgres</em> permission (?)</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<h2>rails-starter-box</h2>
<p>Second attempt. Somewhere in the <em>rails-dev-box</em> community, some body recommends that <a href="https://github.com/amaia/rails-starter-box"><em>rails-starter-box</em></a> be better choice. Using <code>puppet</code> submodule as <code>puppet</code> receipes to set up and configure software; database, git, rvm and ete, was nice. Arm with basic understanding of Puppet, I was able to navigate the files and poke around.</p>
<h3>Issues</h3>
<ul>
<li>RVM installation; possibly due to puppet limitation on binding, the Vagrant up was not as smooth as I hope for. But thanks to their read me I had to write some puppet code to add <code>$rvm_installed == "true"</code> conditional check;
<ul>
<li><code>$rvm_installed</code> is basically a flag in the Puppet set file and detect if <em>RVM</em> is installed. The trouble is the flag <strong>is not</strong> re-bound after Puppet installed <em>RVM</em>. That causes a lot of issues because <code>Ruby</code> and its gem installation setup were relying on the fact that <em>RVM</em> is installed.</li>
<li>Workaround, by adding the conditional check where <strong>Ruby</strong> and <em><strong>Gem</strong> setup, not to proceed at all, and run <code>vagrant up</code> second time after </em>first* run to have <strong>RVM</strong> installed.</li>
</ul>
</li>
<li><code>Node.js</code> or a <code>JavaScript</code> engine does not come with the puppet setup; had to manually installed it with help from <em><a href="http://askubuntu.com/questions/49390/how-do-i-install-the-latest-version-of-node-js">how-do-i-install-the-latest-version-of-node-js</a></em></li>
<li><code>bundle install</code> is finally success for a rails app. The app is finally up and running, but issues with running tests.
<ul>
<li><code>rspec</code> is having some issues with database unicode setup or what not. Trying to <code>createdb</code> and <code>dropdb</code> and etc. Everything seems be fine excep rspec continue complaining.</li>
</ul>
</li>
<li>Postgre version is a bit dated; defaulted to <code>9.1</code>. I wanted <code>9.2</code>, Tried changing <em>params</em> to 9.2 but didn’t work, complainning issues related to <code>pg_hba.conf.erb</code>. I don’t really know but so I gave up at this point.</li>
</ul>
<p>After many hours, I finally start thinking about finding another solution. Good news is the app can run but not test.</p>
<h2>using <a href="http://rove.io/">http://rove.io/</a></h2>
<p>Unlike previous attempts, <code>http://rove.io/</code> can generate Vagrant files and chef according to your need; as opposed to ready made one size fit all box. It is great for me as I know exactly what I need in the box and what I don’t care. However, I have never touch <code>chef</code>.</p>
<p>After following its instructions; in addtional to having <code>vagrant</code> installed on the host, need to run</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>gem install librarian-chef
</span><span class='line'>install `librarian-chef install`</span></code></pre></td></tr></table></div></figure>
<p>to install Chef, I supposed. Then <code>vagrant up</code>. No luck working.</p>
<p>With zero knowledge of how Chef works, it installed packages but a lot of info in the log file.</p>
<h3>Issues (still sorting out - on the verge of giving up)</h3>
<ul>
<li><code>rvm</code> is not install while the log appear to be installed</li>
<li>Issues with starting up <code>mongodb</code> that has been already started.</li>
</ul>
</div>
</article>
<article>
<header>
<h1 class="entry-title"><a href="/blog/2013/04/28/getting-octopress-up-and-running/">Getting Octopress Up and Running</a></h1>
<p class="meta">
<time datetime="2013-04-28T18:27:00+10:00" pubdate data-updated="true">Apr 28<span>th</span>, 2013</time>
</p>
</header>
<div class="entry-content"><p><em><a href="http://octopress.org/">Octopress</a></em> is a framework designed for Jekyll, the static blogging engine powering Github Pages. It sits on top of <a href="https://github.com/mojombo/jekyll">Jekyll</a> and generate <strong>static</strong> html pages from <em>markdown</em> files. It comes with a set of useful <em>rake tasks</em> to <em>preview</em>, <em>deploy</em> pages.</p>
<p>The best part is it comes with rake task to have <code>_deploy</code> folder set up as <em>git</em> sub module that is setup as seperate git repo - it is particular useful when pushing to git pages.</p>
<h2>Setting up locally</h2>
<p><a href="http://octopress.org/docs/setup/">Octopress Setup</a></p>
<figure class='code'> <div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
<span class='line-number'>10</span>
</pre></td><td class='code'><pre><code class='ruby'><span class='line'><span class="c1"># clone octopress</span>
</span><span class='line'><span class="n">git</span> <span class="nb">clone</span> <span class="ss">git</span><span class="p">:</span><span class="sr">//</span><span class="n">github</span><span class="o">.</span><span class="n">com</span><span class="o">/</span><span class="n">imathis</span><span class="o">/</span><span class="n">octopress</span><span class="o">.</span><span class="n">git</span> <span class="n">octopress</span>
</span><span class='line'>
</span><span class='line'><span class="c1"># install gems</span>
</span><span class='line'><span class="n">cd</span> <span class="n">octopress</span>
</span><span class='line'><span class="n">gem</span> <span class="n">install</span> <span class="n">bundler</span>
</span><span class='line'><span class="n">bundle</span> <span class="n">install</span>
</span><span class='line'>
</span><span class='line'><span class="c1"># install default octopress theme</span>
</span><span class='line'><span class="n">rake</span> <span class="n">install</span>
</span></code></pre></td></tr></table></div></figure>
<h3>About GitHub pages</h3>
<p>GitHub pages a free static web pages hosting provided by GitHub - requires GitHub account.</p>
<ul>
<li>Setting up GitHub pages
<ul>
<li>Check out GitHub on how to set up Git Hub Pages for more details.</li>
<li>create a <em>git</em> repo named <code>{your_git_hub_account_name_here}.github.com</code></li>
<li>pushing any static html page will be accessible as web pages at <code>http://{your_git_hub_account_name_here}.github.io/</code></li>
</ul>
</li>
</ul>
<figure class='code'> <div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
</pre></td><td class='code'><pre><code class='ruby'><span class='line'><span class="c1"># setting up for github pages</span>
</span><span class='line'><span class="c1"># See More on 'About GitHub Pages'</span>
</span><span class='line'><span class="c1"># - create a forked version of octopress for the purpose of version controlling the octopres</span>
</span><span class='line'><span class="c1"># - Update the octopress/.git/config</span>
</span><span class='line'><span class="c1"># - Ask for a git repo url for the project (not the git hub pages)</span>
</span><span class='line'><span class="c1"># - rename origin to octopress</span>
</span><span class='line'><span class="c1"># - the changes are not really the octopress core development, so no need for keeping origin</span>
</span><span class='line'><span class="c1"># - add origin to point to the git repo url from the earlier step</span>
</span><span class='line'><span class="n">rake</span> <span class="n">setup_github_pages</span>
</span></code></pre></td></tr></table></div></figure>
<h2>Useful things to know about Octopress</h2>
<ul>
<li><code>_deploy</code>: where the <em>github pages repo</em> as sub module - see <code>_deploy/.git/config</code></li>
<li><code>source</code>: where the generated content by octopress to be further process by <em>Jekyll</em>. (??)
<ul>
<li><code>source/_post</code>: where the markdown files goes</li>
</ul>
</li>
</ul>
<h2>Recommended Workflow</h2>
<figure class='code'> <div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
<span class='line-number'>10</span>
<span class='line-number'>11</span>
<span class='line-number'>12</span>
<span class='line-number'>13</span>
<span class='line-number'>14</span>
<span class='line-number'>15</span>
</pre></td><td class='code'><pre><code class='ruby'><span class='line'><span class="c1"># Create new post</span>
</span><span class='line'><span class="n">rake</span> <span class="n">new_post</span><span class="o">[</span><span class="s2">"this is my first blog"</span><span class="o">]</span>
</span><span class='line'>
</span><span class='line'><span class="c1"># Edit generated initial the markdown file</span>
</span><span class='line'><span class="n">vi</span> <span class="n">source</span><span class="o">/</span><span class="n">_posts</span><span class="o">/</span><span class="mi">20</span><span class="n">xx</span><span class="o">-</span><span class="mi">12</span><span class="o">-</span><span class="mi">31</span><span class="o">-</span><span class="n">this</span><span class="o">-</span><span class="n">is</span><span class="o">-</span><span class="n">my</span><span class="o">-</span><span class="n">first</span><span class="o">-</span><span class="n">blog</span><span class="o">.</span><span class="n">markdown</span>
</span><span class='line'>
</span><span class='line'><span class="c1"># Deploy to GitHub page</span>
</span><span class='line'><span class="c1"># - commit and push github submodule in _deploy</span>
</span><span class='line'><span class="n">rake</span> <span class="n">gen_deploy</span>
</span><span class='line'>
</span><span class='line'><span class="c1"># Commit the new markdown file</span>
</span><span class='line'><span class="n">git</span> <span class="n">add</span> <span class="n">source</span><span class="o">/*</span>
</span><span class='line'>
</span><span class='line'><span class="c1"># Push the source branch</span>
</span><span class='line'><span class="n">git</span> <span class="n">push</span> <span class="n">origin</span> <span class="n">source</span>
</span></code></pre></td></tr></table></div></figure>
</div>
</article>
<div class="pagination">
<a href="/blog/archives">Blog Archives</a>
</div>
</div>
<aside class="sidebar">
<section>
<h1>Recent Posts</h1>
<ul id="recent_posts">
<li class="post">
<a href="/blog/2013/04/29/vagrant-for-rails-application-development/">Vagrant for Rails Application Development</a>
</li>
<li class="post">
<a href="/blog/2013/04/28/getting-octopress-up-and-running/">Getting Octopress Up And Running</a>
</li>
</ul>
</section>
</aside>
</div>
</div>
<footer role="contentinfo"><p>
Copyright © 2013 - Raymond Maung -
<span class="credit">Powered by <a href="http://octopress.org">Octopress</a></span>
</p>
</footer>
<script type="text/javascript">
(function(){
var twitterWidgets = document.createElement('script');
twitterWidgets.type = 'text/javascript';
twitterWidgets.async = true;
twitterWidgets.src = 'http://platform.twitter.com/widgets.js';
document.getElementsByTagName('head')[0].appendChild(twitterWidgets);
})();
</script>
</body>
</html>