-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
648 lines (446 loc) · 25.5 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
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
<!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">
<meta http-equiv="cleartype" content="on">
<title>风依旧的博客 - 风依旧</title>
<meta name="author" content="WindStill">
<meta name="description" content="互联网技术相关的博文">
<meta name="keywords" content="ruby rails iOS OS X blog 博客 tech 科技 hacks mysql ">
<!-- http://t.co/dKP3o1e -->
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Twitter Cards -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="/images/abstract-12.jpg"
<meta name="twitter:title" content="风依旧的博客">
<meta name="twitter:description" content="互联网技术相关的博文">
<meta name="twitter:creator" content="@wind_still">
<!-- Open Graph -->
<meta property="og:local" content="en_US">
<meta property="og:type" content="article">
<meta property="og:url" content="http://windstill.me">
<meta property="og:title" content="风依旧的博客">
<meta property="og:description" content="互联网技术相关的博文">
<meta property="og:image" content="/images/abstract-12.jpg">
<meta property="og:site_name" content="风依旧">
<link rel="canonical" href="http://windstill.me">
<link href="/favicon.png" rel="icon">
<link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet" type="text/css">
<link href="//netdna.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">
<link href="/atom.xml" rel="alternate" title="风依旧" type="application/atom+xml">
<script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script>
<script>Modernizr || document.write('<script src="/javascripts/vendor/modernizr-2.6.2.custom.min.js"><\/script>') </script>
<style type="text/css">body {background-image:url(/images/witewall_3.png);}</style>
<!--Fonts from Google"s Web font directory at http://google.com/webfonts -->
<link href="//fonts.googleapis.com/css?family=PT+Serif:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">
<link href="//fonts.googleapis.com/css?family=PT+Sans:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">
</head>
<body id="post-index" class="feature">
<!--[if lt IE 9]><div class="upgrade"><strong><a href="http://whatbrowser.org/">Your browser is quite old!</strong> Why not upgrade to a different browser to better enjoy this site?</a></div><![endif]-->
<nav id="dl-menu" class="dl-menuwrapper" role="navigation">
<button class="dl-trigger">Open Menu</button>
<ul class="dl-menu">
<li><a href="/">首页</a></li>
<li>
<a href="#">关于</a>
<ul class="dl-submenu">
<li>
<img src="/images/avatar.png" alt="WindStill photo" class="author-photo">
<h4>WindStill</h4>
<p>ruby开发者<br>iOS爱好者</p>
</li>
<li><a href="/about">更多</a></li>
<li>
<a href="http://weibo.com/windstill" target="_blank"><i class="fa fa-weibo"></i> 微博</a>
</li>
<li>
<a href="http://twitter.com/wind_still" target="_blank"><i class="fa fa-twitter"></i> Twitter</a>
</li>
<li>
<a href="https://www.facebook.com/" target="_blank"><i class="fa fa-facebook"></i> Facebook</a>
</li>
<li>
<a href="http://github.com/WindStill" target="_blank"><i class="fa fa-github"></i> GitHub</a>
</li>
</ul><!-- /.dl-submenu -->
</li>
<li>
<a href="#">博客</a>
<ul class="dl-submenu">
<li><a href="/posts/">博文</a></li>
<li><a href="/categories/">分类</a></li>
<li><a href="/archives/">归档</a></li>
</ul>
</li>
</ul><!-- /.dl-menu -->
</nav><!-- /.dl-menuwrapper -->
<div class="entry-header">
<div class="entry-image">
<img src="/images/abstract-12.jpg" alt="风依旧的博客">
</div><!-- /.entry-image -->
<div class="header-title">
<div class="header-title-wrap">
<h1>风依旧</h1>
<h2>取次花丛懒回顾,半缘修道半缘君</h2>
</div><!-- /.header-title-wrap -->
</div><!-- /.header-title -->
</div><!-- /.entry-header -->
<div id="main" role="main">
<article class="hentry">
<header>
<div class="entry-meta">
<span class="entry-date date published updated">
<time datetime="2014-11-05T14:23:45+08:00">
<a href="/blog/2014/11/05/ssl-with-nginx/">2014-11-05</a>
</time>
</span>
<span class="author vcard">
<span class="fn">
<a href="" title="About WindStill">WindStill</a>
</span>
</span>
</div><!-- /.entry-meta -->
<h1 class="entry-title">
<a href="/blog/2014/11/05/ssl-with-nginx/" rel="bookmark" title="SSL证书申请与在Nginx下的配置" itemprop="url">SSL证书申请与在Nginx下的配置</a>
</h1>
</header>
<div class="entry-content">
<p>http协议默认情况下是不加密的,各种信息都是明文传送。SSL是Secure Socket Layer的简称,具体的作用就是在部署了SSL证书的网站跟用户浏览器之间建立一个安全的会话。以防止信息在互联网任何中间节点上被盗用。</p>
<h4>购买SSL</h4>
<p>如果购买就不赘述了,我是从 <a href="https://www.ssls.com/">SSLs.com</a>购买的<strong>Positive SSL</strong>,$4.99/年。可以比较下其他提供商,按需购买。</p>
<h4>申请证书</h4>
<p>一般购买SSL后,激活的时候会要求提供一下 CSR 的内容。CSR 就是 Certificate Signing Request 简称,需要去部署的服务器上生成一个。步骤如下:</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>
<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>
</pre></td><td class='code'><pre><code class=''><span class='line'>sudo mkdir /etc/nginx/ssl
</span><span class='line'>cd /etc/nginx/ssl
</span><span class='line'>
</span><span class='line'>#生成private key
</span><span class='line'>sudo openssl genrsa -des3 -out server.key 2048
</span><span class='line'>这里问你输入一个passphrase,选择一个容易记得,后面会用到
</span><span class='line'>
</span><span class='line'>#生成 CSR
</span><span class='line'>sudo openssl req -new -key server.key -out server.csr
</span><span class='line'>
</span><span class='line'>Country Name (2 letter code) [AU]:
</span><span class='line'>State or Province Name (full name) [Some-State]:
</span><span class='line'>Locality Name (eg, city) []:
</span><span class='line'>Organization Name (eg, company) [Internet Widgits Pty Ltd]:
</span><span class='line'>Organizational Unit Name (eg, section) []:
</span><span class='line'>Common Name (e.g. server FQDN or YOUR name) []:
</span><span class='line'>Email Address []:
</span><span class='line'>A challenge password []:
</span><span class='line'>An optional company name []:</span></code></pre></td></tr></table></div></figure>
<p>输入内容说明:</p>
<table>
<thead>
<tr>
<th style="text-align:left;"> 输入内容</th>
<th style="text-align:left;"> 说明 </th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left;">Country Name (2 letter code) </td>
<td style="text-align:left;"> 使用国际标准组织(ISO)国码格式,填写2个字母的国家代号。中国请填写CN</td>
</tr>
<tr>
<td style="text-align:left;">State or Province Name (full name)</td>
<td style="text-align:left;"> 省份,如 Beijing</td>
</tr>
<tr>
<td style="text-align:left;">Locality Name (eg, city)</td>
<td style="text-align:left;"> 城市,如 Beijing</td>
</tr>
<tr>
<td style="text-align:left;">Organization Name (eg, company)</td>
<td style="text-align:left;">公司名称</td>
</tr>
<tr>
<td style="text-align:left;">Organizational Unit Name</td>
<td style="text-align:left;">部门名称</td>
</tr>
<tr>
<td style="text-align:left;">Common Name (eg, your websites domain name)</td>
<td style="text-align:left;">网站域名,注意区分abc.com和www.abc.com是不同的</td>
</tr>
<tr>
<td style="text-align:left;">Email Address</td>
<td style="text-align:left;">邮件地址,可不填</td>
</tr>
<tr>
<td style="text-align:left;">A challenge password</td>
<td style="text-align:left;">可不填</td>
</tr>
<tr>
<td style="text-align:left;">An optional company name</td>
<td style="text-align:left;">可不填</td>
</tr>
</tbody>
</table>
<footer>
<a class="btn" rel="full-article" href="/blog/2014/11/05/ssl-with-nginx/">阅读全文 →</a>
</footer>
</div><!-- /.entry-content -->
</article><!-- /.hentry -->
<article class="hentry">
<header>
<div class="entry-meta">
<span class="entry-date date published updated">
<time datetime="2014-10-29T09:58:44+08:00">
<a href="/blog/2014/10/29/kindleear-rss-kindle/">2014-10-29</a>
</time>
</span>
<span class="author vcard">
<span class="fn">
<a href="" title="About WindStill">WindStill</a>
</span>
</span>
</div><!-- /.entry-meta -->
<h1 class="entry-title">
<a href="/blog/2014/10/29/kindleear-rss-kindle/" rel="bookmark" title="使用KindleEar免费把RSS订阅定时推送到Kindle" itemprop="url">使用KindleEar免费把RSS订阅定时推送到Kindle</a>
</h1>
</header>
<div class="entry-content">
<p>Kindle是亚马逊推出的电纸书阅读器,采用电子墨水屏幕,其优点是非常省电且显示效果非常接近纸,可以在太阳底下阅读。前段时间入手Kindle PaperWhite后,就一直琢磨着如何把原来用Rss订阅的内容推送到kindle上来看。</p>
<h3>可选择的方式</h3>
<p>目前通过搜集的可行的方式大概有三种</p>
<h4>Rss推送网站</h4>
<p>现在有不少把RSS订阅推送到Kindle的服务,比较流行的有以下三个:</p>
<p>1.ReadCola</p>
<p><a href="http://readcola.com/">ReadCola</a>可以生成期刊格式,便于翻阅,媲美纸质杂志;针对阅读器对图片优化,内容重新排版,提升阅读体验。支持定时推送,相比其它推送站最大的特色就是可以推送自定义的Rss并且带有图片,缺点是只支持16个订阅。</p>
<p>2.狗耳朵</p>
<p><a href="http://www.mydogear.com/">狗耳朵</a>内置资源非常多,包括RSS和微信公众号,支持定时推送。缺点是免费用户无法推送图片,不能添加自定义Rss,付费用户是可以的,不过费用也不算贵,现在是3元每月或30元每年。</p>
<p>3.Kindle4Rss</p>
<p><a href="http://kindle4rss.com/">Kindle4Rss</a>也分免费和付费用户,二则的区别如下:
<img class="center" src="http://windstill.qiniudn.com/QQ20141029-1.png"></p>
<footer>
<a class="btn" rel="full-article" href="/blog/2014/10/29/kindleear-rss-kindle/">阅读全文 →</a>
</footer>
</div><!-- /.entry-content -->
</article><!-- /.hentry -->
<article class="hentry">
<header>
<div class="entry-meta">
<span class="entry-date date published updated">
<time datetime="2014-10-21T12:05:15+08:00">
<a href="/blog/2014/10/21/using-hash-and-array-of-hstore-with-rails/">2014-10-21</a>
</time>
</span>
<span class="author vcard">
<span class="fn">
<a href="" title="About WindStill">WindStill</a>
</span>
</span>
</div><!-- /.entry-meta -->
<h1 class="entry-title">
<a href="/blog/2014/10/21/using-hash-and-array-of-hstore-with-rails/" rel="bookmark" title="在Rails中使用hstore和Array类型" itemprop="url">在Rails中使用hstore和Array类型</a>
</h1>
</header>
<div class="entry-content">
<p>最近项目技术选型从 MySQL+MongoDB 转到 PostgreSQL,但是 MongoDB 支持存储 Array 和 JSON 数据类型在某些场景下还是很方便的。比如手机通讯录里的联系人,一个联系人有多个号码、多个地址,如果使用传统的数据类型,可能要三个表来存储这些信息;另一个问题在于,一般编辑联系人的时候,会同时增删改N个号码 + N条地址,这是再去操作三个表逻辑上也会复杂不少。但是如果把多个号码和多个地址以 JSON 的 array 及 key-value 形式存储在同一个字段中,这样曾删改的时候会方便很多。索性PostgreSQL,也有相应的字段类型来支持此场景,比如 hstore。</p>
<p>Rails 4.1 中的一个新特性就是对 PostgreSQL 的hstore类型的支持。而 Rails 之前的版本需要安装 <a href="https://github.com/diogob/activerecord-postgres-hstore"><code>activerecord-postgres-hstore</code></a> gem。下面说说 Rails 中使用 hstore 的方法。</p>
<h3>增加 hstore extenstion</h3>
<p>首先创建一个migration,启用 hstore extension。</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>
</pre></td><td class='code'><pre><code class='ruby'><span class='line'><span class="k">class</span> <span class="nc">AddHstoreExtension</span> <span class="o"><</span> <span class="ss">ActiveRecord</span><span class="p">:</span><span class="ss">:Migration</span>
</span><span class='line'> <span class="k">def</span> <span class="nc">self</span><span class="o">.</span><span class="nf">up</span>
</span><span class='line'> <span class="n">execute</span> <span class="s2">"CREATE EXTENSION IF NOT EXISTS hstore"</span>
</span><span class='line'> <span class="k">end</span>
</span><span class='line'>
</span><span class='line'> <span class="k">def</span> <span class="nc">self</span><span class="o">.</span><span class="nf">down</span>
</span><span class='line'> <span class="n">execute</span> <span class="s2">"DROP EXTENSION IF EXISTS hstore"</span>
</span><span class='line'> <span class="k">end</span>
</span><span class='line'><span class="k">end</span>
</span></code></pre></td></tr></table></div></figure>
<p>还有一种更简便的写法,不需要用 execute 执行原生的 SQL 语句。</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>
</pre></td><td class='code'><pre><code class='ruby'><span class='line'><span class="k">class</span> <span class="nc">AddHstoreExtension</span> <span class="o"><</span> <span class="ss">ActiveRecord</span><span class="p">:</span><span class="ss">:Migration</span>
</span><span class='line'> <span class="k">def</span> <span class="nc">self</span><span class="o">.</span><span class="nf">up</span>
</span><span class='line'> <span class="n">enable_extension</span> <span class="ss">:hstore</span>
</span><span class='line'> <span class="k">end</span>
</span><span class='line'>
</span><span class='line'> <span class="k">def</span> <span class="nc">self</span><span class="o">.</span><span class="nf">down</span>
</span><span class='line'> <span class="n">disable_extension</span> <span class="ss">:hstore</span>
</span><span class='line'> <span class="k">end</span>
</span><span class='line'><span class="k">end</span>
</span></code></pre></td></tr></table></div></figure>
<footer>
<a class="btn" rel="full-article" href="/blog/2014/10/21/using-hash-and-array-of-hstore-with-rails/">阅读全文 →</a>
</footer>
</div><!-- /.entry-content -->
</article><!-- /.hentry -->
<article class="hentry">
<header>
<div class="entry-meta">
<span class="entry-date date published updated">
<time datetime="2014-10-15T15:24:58+08:00">
<a href="/blog/2014/10/15/rails-with-postgis/">2014-10-15</a>
</time>
</span>
<span class="author vcard">
<span class="fn">
<a href="" title="About WindStill">WindStill</a>
</span>
</span>
</div><!-- /.entry-meta -->
<h1 class="entry-title">
<a href="/blog/2014/10/15/rails-with-postgis/" rel="bookmark" title="使用Rails和Postgis开发基于地理位置应用的安装与配置" itemprop="url">使用Rails和Postgis开发基于地理位置应用的安装与配置</a>
</h1>
</header>
<div class="entry-content">
<p><a href="http://postgis.refractions.net/"><code>PostGIS</code></a> 是关系型数据库 <a href="http://www.postgresql.org/"><code>PostgreSQL</code></a> 一个扩展,它为PostgreSQL提供了存储空间地理数据的支持,使PostgreSQL成为了一个空间数据库,能够进行空间数据管理、数量测量与几何拓扑分析。现在已经有好多为 Rails 提供地理空间数据操作的 gem。所以处理地理空间数据还是比较简单的,但是开发环境配置还有不少工作要做。</p>
<h3>环境依赖</h3>
<p>本文以 Mac OS X系统为例,需要安装以下内容:</p>
<ul>
<li> XCode</li>
<li> Homebrew</li>
<li> Postgresql</li>
<li> Postgis</li>
<li> Ruby</li>
<li> Rails</li>
</ul>
<p>下面单说 Postgresql 及 Postgis 安装</p>
<h4>安装 Postgresql 和 Postgis</h4>
<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'>brew install postgresql
</span><span class='line'>brew install postgis</span></code></pre></td></tr></table></div></figure>
<h4>检查系统是否正确安装 postgis</h4>
<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'>~$ psql -U username
</span><span class='line'>=# select pg_available_extensions where name like ‘postgis%’;</span></code></pre></td></tr></table></div></figure>
<p>Mac 用户还可以直接下载 <a href="http://postgresapp.com/"><code>Postgres.app</code></a>,拖入applications文件夹。Postgres.app 包含 PostgreSQL 常用的扩展和工具:</p>
<footer>
<a class="btn" rel="full-article" href="/blog/2014/10/15/rails-with-postgis/">阅读全文 →</a>
</footer>
</div><!-- /.entry-content -->
</article><!-- /.hentry -->
<article class="hentry">
<header>
<div class="entry-meta">
<span class="entry-date date published updated">
<time datetime="2014-07-16T10:50:42+08:00">
<a href="/blog/2014/07/16/imagemagick-rmagick-osx/">2014-07-16</a>
</time>
</span>
<span class="author vcard">
<span class="fn">
<a href="" title="About WindStill">WindStill</a>
</span>
</span>
</div><!-- /.entry-meta -->
<h1 class="entry-title">
<a href="/blog/2014/07/16/imagemagick-rmagick-osx/" rel="bookmark" title="解决ImageMagick和RMagick在OS X下使用出现的问题" itemprop="url">解决ImageMagick和RMagick在OS X下使用出现的问题</a>
</h1>
</header>
<div class="entry-content">
<p>每次安装 <code>RMagick</code> 这个gem都会遇到问题,并且每次的问题还都不一样,有的时候是 <code>ImageMagick</code> 的问题,有时候是 <code>RMagick</code> 不能安装,这次是安装了以后,启动Rails的时候,报错说是 <code>libMagickCore-6.Q16.2.dylib</code> 版本不对。错误详情如下:</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>
<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>
</pre></td><td class='code'><pre><code class=''><span class='line'>/Users/windstill/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in `require': dlopen(/Users/windstill/.rvm/gems/ruby-1.9.3-p194/extensions/x86_64-darwin-13/1.9.1/rmagick-2.13.2/RMagick2.bundle, 9): Library not loaded: /usr/local/lib/libltdl.7.dylib (LoadError)
</span><span class='line'> Referenced from: /usr/local/lib/libMagickCore-6.Q16.2.dylib
</span><span class='line'> Reason: Incompatible library version: libMagickCore-6.Q16.2.dylib requires version 11.0.0 or later, but libltdl.7.dylib provides version 10.0.0 - /Users/windstill/.rvm/gems/ruby-1.9.3-p194/extensions/x86_64-darwin-13/1.9.1/rmagick-2.13.2/RMagick2.bundle
</span><span class='line'> from /Users/windstill/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in `block in require'
</span><span class='line'> from /Users/windstill/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:236:in `load_dependency'
</span><span class='line'> from /Users/windstill/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in `require'
</span><span class='line'> from /Users/windstill/.rvm/gems/ruby-1.9.3-p194/gems/rmagick-2.13.2/lib/rmagick.rb:11:in `<top (required)>'
</span><span class='line'> from /Users/windstill/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.6.3/lib/bundler/runtime.rb:76:in `require'
</span><span class='line'> from /Users/windstill/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.6.3/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
</span><span class='line'> from /Users/windstill/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.6.3/lib/bundler/runtime.rb:72:in `each'
</span><span class='line'> from /Users/windstill/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.6.3/lib/bundler/runtime.rb:72:in `block in require'
</span><span class='line'> from /Users/windstill/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.6.3/lib/bundler/runtime.rb:61:in `each'
</span><span class='line'> from /Users/windstill/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.6.3/lib/bundler/runtime.rb:61:in `require'
</span><span class='line'> from /Users/windstill/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.6.3/lib/bundler.rb:132:in `require'
</span><span class='line'> from /Users/windstill/dev/rails/movie/config/application.rb:13:in `<top (required)>'
</span><span class='line'> from /Users/windstill/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.12/lib/rails/commands.rb:39:in `require'
</span><span class='line'> from /Users/windstill/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.12/lib/rails/commands.rb:39:in `<top (required)>'
</span><span class='line'> from script/rails:6:in `require'
</span><span class='line'> from script/rails:6:in `<main>'</span></code></pre></td></tr></table></div></figure>
<p>使用 <code>brew unlink libtool && brew link libtool</code> 命令解决问题。可能会出现如下问题:</p>
<footer>
<a class="btn" rel="full-article" href="/blog/2014/07/16/imagemagick-rmagick-osx/">阅读全文 →</a>
</footer>
</div><!-- /.entry-content -->
</article><!-- /.hentry -->
<div class="pagination">
<a href="/archives" class="archives">博客归档</a>
<a href="/posts/2" class="btn">下一页</a>
</div><!-- /.pagination -->
</div><!-- /#main -->
<div class="footer-wrapper">
<footer role="contentinfo">
<span>© 2016 WindStill
</footer>
</div><!-- /.footer-wrapper -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="/javascripts/vendor/jquery-1.9.1.min.js"><\/script>')</script>
<script src="/javascripts/octopress.js" type="text/javascript"></script>
<script src="/javascripts/scripts.min.js"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-46781558-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</body>
</html>