/
index.html
419 lines (304 loc) · 17 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
408
409
410
411
412
413
414
415
416
417
418
419
<!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>Install Ruby Enterprise Edition With ruby-build On Arch Linux - Garbled</title>
<meta name="author" content="Ben Hamill">
<meta name="description" content="I run Arch Linux on a computer, if I have a
choice. I recently installed it on the MacBook Air my employer bought me (which
saga is another post …">
<!-- 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://garbled.benhamill.com/2012/02/03/install-ruby-enterprise-edition-with-ruby-install-on-arch-linux">
<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="Garbled" 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="/">Garbled</a></h1>
</hgroup>
</header>
<nav role="navigation"><div>
<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:garbled.benhamill.com" />
<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>
<li><a href="/about">About</a></li>
</ul>
<div>
</nav>
<div id="main-wrapper">
<div id="main">
<div id="content">
<div>
<article class="hentry" role="article">
<header>
<h1 class="entry-title">Install Ruby Enterprise Edition With Ruby-build on Arch Linux</h1>
<p class="meta">
<time datetime="2012-02-03T00:00:00-06:00" pubdate data-updated="true">Feb 3<span>rd</span>, 2012</time>
</p>
</header>
<div class="entry-content"><p>I run <a href="http://www.archlinux.org/">Arch Linux</a> on a computer, if I have a
choice. I recently installed it on the MacBook Air my employer bought me (which
saga is another post entirely). One of the things that I like about Arch is
that they don't do big releases every X-period of time; the package repository
is updated on a rolling basis. So I can get the latest version of whatever much
sooner than my Ubuntuan brethren.</p>
<p>That's awesome, but also has some costs. One of those costs is that gcc gets
updated for me way sooner than it does for people releasing Ruby versions and
sometimes there are weird things that older releases of the compiler were more
forgiving about or interpreted differently or whatever. So in order to get our
app at work that we haven't yet ported to Ruby 1.9.2 to run, I need to have REE
installed. This is how I got it done. This is one of those blog posts that I
hope gets indexed so that the next time I have to do this and I ask Google
about it, it will show me my own blog post.</p>
<h2>Ruby-build</h2>
<p>I like <a
title="rbenv on GitHub" href="https://github.com/sstephenson/rbenv"
target="_blank">rbenv</a>. A lot of people prefer <a title="RVM"
href="http://beginrescueend.com/" target="_blank">rvm</a>. I don't want to
get into pros and cons or whatever now, but because I use rbenv for managing
multiple ruby versions, I use <a title="ruby-build on GitHub"
href="https://github.com/sstephenson/ruby-build"
target="_blank">ruby-build</a> to install multiple ruby versions. The way
ruby-build works is by executing recipes, which are pretty simple. Here is the
one I wrote to handle the install. It's just a variation on the stock REE
install recipe from ruby-build.</p>
<figure class='code'><figcaption><span>ree-1.8.7-2011.12-stdout_patch</span></figcaption><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>
</pre></td><td class='code'><pre><code class='ruby'><span class='line'><span class="n">build_package_stdout_patch</span><span class="p">()</span> <span class="p">{</span>
</span><span class='line'> <span class="n">wget</span> <span class="s1">'http://bugs.ruby-lang.org/attachments/download/1931/stdout-rouge-fix.patch'</span>
</span><span class='line'> <span class="n">patch</span> <span class="o">-</span><span class="n">p1</span> <span class="o"><</span> <span class="n">stdout</span><span class="o">-</span><span class="n">rouge</span><span class="o">-</span><span class="n">fix</span><span class="o">.</span><span class="n">patch</span>
</span><span class='line'><span class="p">}</span>
</span><span class='line'>
</span><span class='line'><span class="n">require_gcc</span>
</span><span class='line'><span class="n">install_package</span> <span class="s2">"ruby-enterprise-1.8.7-2011.12"</span> <span class="s2">"http://rubyenterpriseedition.googlecode.com/files/ruby-enterprise-1.8.7-2011.12.tar.gz"</span> <span class="n">stdout_patch</span> <span class="n">ree_installer</span>
</span><span class='line'><span class="n">install_package</span> <span class="s2">"rubygems-1.6.2"</span> <span class="s2">"http://production.cf.rubygems.org/rubygems/rubygems-1.6.2.tgz"</span> <span class="n">ruby</span>
</span></code></pre></td></tr></table></div></figure>
<p>I won't get deep into the details, but let's start with the last 3 lines.
Ruby-build executes each of these directives in turn. The first of the three
sets up the compiler and the next two each take a series of arguments. The
first two of those arguments are what it's installing and where to get it. Any
after that (you'll have to scroll right) are telling it what to do with it,
once it's downloaded it. It will run the last arguments in the order given. So
that brings us to the function I added at the
top: <code>build_package_stdout_patch</code>.</p>
<p>When you pass those ending arguments into <code>install package</code>, it will
look to execute a function by the name you gave it prepended with
<code>build_package_</code>. So the function I wrote downloads a patch for a
bug having to do with <a title="Ruby 1.8 - Bug #5108: ruby 1.8.7 fails to build
with glibc 2.14 - Ruby Issue Tracking System"
href="http://bugs.ruby-lang.org/issues/5108" target="_blank">creating rogue references to STDOUT</a>,
then issues the patch command to work it into the
REE source. I don't know a lot about the patch command, so there's a good
chance this could be done more nicely (see below). After that, it runs
ruby-build's standard ree_installer task wich builds and installs the REE
source.</p>
<h2>Running It</h2>
<p>When you're using ruby-build and rbenv together,
you get a nice command called <code>rbenv install</code>. You can either pass
it the name of a recipe that ruby-build already knows about or the path to a
recipe on your hard drive somewhere. So, in the directory where I had saved my
recipe, I ran:</p>
<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='text'><span class='line'>$ CONFIGURE_OPTS="--no-tcmalloc" rbenv install ./ree-1.8.7-0211.12-stdout_patch
</span></code></pre></td></tr></table></div></figure>
<p>Note: There's some kind of problem with tcmalloc and the newest gcc. Or
something. I don't really understand, but since this is just for local
development, I decided not to worry too much about performance and skip it. If
you set the environment variable <code>CONFIGURE_OPTS</code>, ruby-build will
pass those options along in it's build process. So off it goes to the races.
Then, I get this output:</p>
<figure class='code'><figcaption><span></span></figcaption><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>
<span class='line-number'>16</span>
<span class='line-number'>17</span>
<span class='line-number'>18</span>
<span class='line-number'>19</span>
<span class='line-number'>20</span>
<span class='line-number'>21</span>
<span class='line-number'>22</span>
<span class='line-number'>23</span>
<span class='line-number'>24</span>
<span class='line-number'>25</span>
<span class='line-number'>26</span>
<span class='line-number'>27</span>
<span class='line-number'>28</span>
</pre></td><td class='code'><pre><code class='text'><span class='line'>Downloading http://rubyenterpriseedition.googlecode.com/files/ruby-enterprise-1.8.7-2011.12.tar.gz...
</span><span class='line'>Installing ruby-enterprise-1.8.7-2011.12...
</span><span class='line'>--2012-02-03 12:07:35-- http://bugs.ruby-lang.org/attachments/download/1931/stdout-rouge-fix.patch
</span><span class='line'>Resolving bugs.ruby-lang.org... 210.251.121.216
</span><span class='line'>Connecting to bugs.ruby-lang.org|210.251.121.216|:80... connected.
</span><span class='line'>HTTP request sent, awaiting response... 200 OK
</span><span class='line'>Length: 719 [text/x-patch]
</span><span class='line'>Saving to: `stdout-rouge-fix.patch'
</span><span class='line'>
</span><span class='line'>100%[======================================================>] 719 --.-K/s in 0s
</span><span class='line'>
</span><span class='line'>2012-02-03 12:07:36 (68.9 MB/s) - `stdout-rouge-fix.patch' saved [719/719]
</span><span class='line'>
</span><span class='line'>can't find file to patch at input line 5
</span><span class='line'>Perhaps you used the wrong -p or --strip option?
</span><span class='line'>The text leading up to this was:
</span><span class='line'>--------------------------
</span><span class='line'>|diff --git a/lib/mkmf.rb b/lib/mkmf.rb
</span><span class='line'>|index c9e738a..7a8004d 100644
</span><span class='line'>|--- a/lib/mkmf.rb
</span><span class='line'>|+++ b/lib/mkmf.rb
</span><span class='line'>--------------------------
</span><span class='line'>File to patch: source/lib/mkmf.rb
</span><span class='line'>patching file source/lib/mkmf.rb
</span><span class='line'>Installed ruby-enterprise-1.8.7-2011.12 to /home/ben/.rbenv/versions/ree-1.8.7-0211.12-stdout_patch
</span><span class='line'>Downloading http://production.cf.rubygems.org/rubygems/rubygems-1.6.2.tgz...
</span><span class='line'>Installing rubygems-1.6.2...
</span><span class='line'>Installed rubygems-1.6.2 to /home/ben/.rbenv/versions/ree-1.8.7-0211.12-stdout_patch
</span></code></pre></td></tr></table></div></figure>
<p>Pay particular attention to the last half of this. After the progress bar,
patch gets confused. That's because the patch is really for Ruby 1.8.7 MRI, not
REE. So it complains about not being able to find the file it wants since the
projects have slightly different directory structures. You can see where I
entered the correct path (basically, I just prepended the <code>source</code>
directory). With that information, the patch applies cleanly, it builds REE
without tcmalloc and now I have a ruby called
<code>ree-1.8.7-0211.12-stdout_patch</code>. Hopefully that's helpful to
someone besides me.</p>
</div>
<footer>
<p class="meta">
<span class="byline author vcard">Posted by <span class="fn">Ben Hamill</span></span>
<time datetime="2012-02-03T00:00:00-06:00" pubdate data-updated="true">Feb 3<span>rd</span>, 2012</time>
</p>
<p class="no-comments meta">
There's not a comments section on this blog any more. If you<br>
want, tweet at me or write your own post and send me the link.
</p>
<div class="sharing">
<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://garbled.benhamill.com/2012/02/03/install-ruby-enterprise-edition-with-ruby-install-on-arch-linux/" data-via="benhamill" data-counturl="http://garbled.benhamill.com/2012/02/03/install-ruby-enterprise-edition-with-ruby-install-on-arch-linux/" >Tweet</a>
</div>
<p class="meta">
<a class="basic-alignment left" href="/2012/01/19/changems/" title="Previous Post: Changems">« Changems</a>
<a class="basic-alignment right" href="/2012/08/31/lol-civil-liberties/" title="Next Post: LOL Civil Liberties">LOL Civil Liberties »</a>
</p>
</footer>
</article>
</div>
<aside class="sidebar">
<section>
<h1>About Me</h1>
<div id="twitter-profile">
<div id="author-card">
<img src="http://www.gravatar.com/avatar/4938b4569f1366168b705ce9c774ea5e" alt="Gravatar of Ben Hamill " title="Gravatar of Ben Hamill" />
<p id="name">Ben Hamill</p>
<p id="handle">@<a href="http://twitter.com/benhamill">benhamill</a></p>
<p id="liame">
<span id="obf"><script>document.getElementById("obf").innerHTML="<n uers=\"znvygb:ora@oraunzvyy.pbz\" gnetrg=\"_oynax\">ora@oraunzvyy.pbz</n>".replace(/[a-zA-Z]/g,function(c){return String.fromCharCode((c<="Z"?90:122)>=(c=c.charCodeAt(0)+13)?c:c-26);});</script>
<noscript><span style="unicode-bidi:bidi-override;direction:rtl;">moc.llimahneb@neb</span></noscript></span>
</p>
</div>
<p>Rubyist, hacker, gamer (video, board, role-playing), fanboy (Linux, git, vim, Firefly, Dr Pepper), language pedant. Nerd.</p>
</div>
</section>
<section>
<h1>Recent Posts</h1>
<ul id="recent_posts">
<li class="post">
<a href="/2013/11/12/hal-client-update-cetacean/">HAL Client Update: Cetacean</a>
</li>
<li class="post">
<a href="/2013/11/05/thinking-about-hal-clients/">Thinking About HAL Clients</a>
</li>
<li class="post">
<a href="/2013/09/18/bens-gem-maintainer-handbook/">Ben's Gem Maintainer Handbook</a>
</li>
<li class="post">
<a href="/2013/09/03/never-type-bundle-exec-again/">Never Type bundle exec Again</a>
</li>
<li class="post">
<a href="/2013/04/28/social-justice-is-made-of-empathy/">Social Justice is Made of Empathy</a>
</li>
</ul>
</section>
<section>
<h1>GitHub Repos</h1>
<ul id="gh_repos">
<li class="loading">Status updating...</li>
</ul>
<a href="https://github.com/benhamill">@benhamill</a> on GitHub
<script type="text/javascript">
$(document).ready(function(){
if (!window.jXHR){
var jxhr = document.createElement('script');
jxhr.type = 'text/javascript';
jxhr.src = '/javascripts/libs/jXHR.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(jxhr, s);
}
github.showRepos({
user: 'benhamill',
count: 5,
skip_forks: true,
target: '#gh_repos'
});
});
</script>
<script src="/javascripts/github.js" type="text/javascript"> </script>
</section>
</aside>
</div>
</div>
</div>
<footer role="contentinfo"><p>
Copyright © 2013 - Ben Hamill -
<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>