-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathatom.xml
239 lines (184 loc) · 13.9 KB
/
atom.xml
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
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title><![CDATA[Raymond on Everything]]></title>
<link href="http://raymaung.github.io/atom.xml" rel="self"/>
<link href="http://raymaung.github.io/"/>
<updated>2013-05-02T22:37:22+10:00</updated>
<id>http://raymaung.github.io/</id>
<author>
<name><![CDATA[Raymond Maung]]></name>
</author>
<generator uri="http://octopress.org/">Octopress</generator>
<entry>
<title type="html"><![CDATA[Vagrant for Rails Application Development]]></title>
<link href="http://raymaung.github.io/blog/2013/04/29/vagrant-for-rails-application-development/"/>
<updated>2013-04-29T08:15:00+10:00</updated>
<id>http://raymaung.github.io/blog/2013/04/29/vagrant-for-rails-application-development</id>
<content type="html"><![CDATA[<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>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Getting Octopress Up And Running]]></title>
<link href="http://raymaung.github.io/blog/2013/04/28/getting-octopress-up-and-running/"/>
<updated>2013-04-28T18:27:00+10:00</updated>
<id>http://raymaung.github.io/blog/2013/04/28/getting-octopress-up-and-running</id>
<content type="html"><![CDATA[<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>
]]></content>
</entry>
</feed>