<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>fishinhouse (sean)</title>
    <link>https://ruby-china.org/fishinhouse</link>
    <description></description>
    <language>en-us</language>
    <item>
      <title>rails 4.0 建立项目默认缺少 2 个 gem，导致启动失败。</title>
      <description>&lt;h2 id="Rails 4.0.0 "&gt;Rails 4.0.0 &lt;/h2&gt;
&lt;p&gt;$rails new webapp
项目建立成功。
cd webapp
修改 Gemfile 的源：source '&lt;a href="http://ruby.taobao.org" rel="nofollow" target="_blank"&gt;http://ruby.taobao.org&lt;/a&gt;'
$bundle install
启动
$rails s
/home/wangliang/.rvm/gems/ruby-2.0.0-p247/gems/execjs-1.4.0/lib/execjs/runtimes.rb:51:in &lt;code&gt;autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
    from /home/wangliang/.rvm/gems/ruby-2.0.0-p247/gems/execjs-1.4.0/lib/execjs.rb:5:in&lt;/code&gt;&lt;a rel="nofollow" target="_blank"&gt;module:ExecJS&lt;/a&gt;'
    from /home/wangliang/.rvm/gems/ruby-2.0.0-p247/gems/execjs-1.4.0/lib/execjs.rb:4:in &lt;code&gt;&amp;lt;top (required)&amp;gt;'
    from /home/wangliang/.rvm/gems/ruby-2.0.0-p247/gems/uglifier-2.1.1/lib/uglifier.rb:3:in&lt;/code&gt;require'
    from /home/wangliang/.rvm/gems/ruby-2.0.0-p247/gems/uglifier-2.1.1/lib/uglifier.rb:3:in &lt;code&gt;&amp;lt;top (required)&amp;gt;'
    from /home/wangliang/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in&lt;/code&gt;require'
    from /home/wangliang/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in &lt;code&gt;block (2 levels) in require'
    from /home/wangliang/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in&lt;/code&gt;each'
    from /home/wangliang/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in &lt;code&gt;block in require'
    from /home/wangliang/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in&lt;/code&gt;each'
    from /home/wangliang/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in &lt;code&gt;require'
    from /home/wangliang/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler.rb:132:in&lt;/code&gt;require'
    from /home/wangliang/ruby-china/config/application.rb:7:in &lt;code&gt;&amp;lt;top (required)&amp;gt;'
    from /home/wangliang/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/commands.rb:76:in&lt;/code&gt;require'
    from /home/wangliang/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/commands.rb:76:in &lt;code&gt;block in &amp;lt;top (required)&amp;gt;'
    from /home/wangliang/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/commands.rb:73:in&lt;/code&gt;tap'
    from /home/wangliang/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/commands.rb:73:in &lt;code&gt;&amp;lt;top (required)&amp;gt;'
    from bin/rails:4:in&lt;/code&gt;require'&lt;/p&gt;
&lt;h2 id="from bin/rails:4:in `'"&gt;    from bin/rails:4:in `'
&lt;/h2&gt;
&lt;p&gt;解决办法：
vim Gemfile
添加
gem 'execjs'
gem 'therubyracer'
$bundle install
$rails s
=&amp;gt; Booting WEBrick
=&amp;gt; Rails 4.0.0 application starting in development on &lt;a href="http://0.0.0.0:3000" rel="nofollow" target="_blank"&gt;http://0.0.0.0:3000&lt;/a&gt;
=&amp;gt; Run &lt;code&gt;rails server -h&lt;/code&gt; for more startup options
=&amp;gt; Ctrl-C to shutdown server
[2013-07-13 00:11:52] INFO  WEBrick 1.3.1
[2013-07-13 00:11:52] INFO  ruby 2.0.0 (2013-06-27) [x86_64-linux]
[2013-07-13 00:11:52] INFO  WEBrick::HTTPServer#start: pid=28681 port=3000&lt;/p&gt;</description>
      <author>fishinhouse</author>
      <pubDate>Sat, 13 Jul 2013 00:19:05 +0800</pubDate>
      <link>https://ruby-china.org/topics/12473</link>
      <guid>https://ruby-china.org/topics/12473</guid>
    </item>
    <item>
      <title>安装 ruby-debug 时报错</title>
      <description>&lt;p&gt;$gem install ruby-debug&lt;/p&gt;

&lt;p&gt;Fetching: columnize-0.3.6.gem (100%)
Successfully installed columnize-0.3.6
Fetching: rbx-require-relative-0.0.9.gem (100%)
Successfully installed rbx-require-relative-0.0.9
Fetching: linecache-0.46.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing ruby-debug:
    ERROR: Failed to build gem native extension.&lt;/p&gt;

&lt;p&gt;/home/wangliang/.rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb
Can't handle 1.9.x yet
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.&lt;/p&gt;

&lt;p&gt;Provided configuration options:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/home/wangliang/.rvm/rubies/ruby-2.0.0-p247/bin/ruby&lt;/p&gt;

&lt;p&gt;Gem files will remain installed in /home/wangliang/.rvm/gems/ruby-2.0.0-p247/gems/linecache-0.46 for inspection.
Results logged to /home/wangliang/.rvm/gems/ruby-2.0.0-p247/gems/linecache-0.46/ext/gem_make.out&lt;/p&gt;</description>
      <author>fishinhouse</author>
      <pubDate>Fri, 12 Jul 2013 20:09:21 +0800</pubDate>
      <link>https://ruby-china.org/topics/12470</link>
      <guid>https://ruby-china.org/topics/12470</guid>
    </item>
    <item>
      <title>推荐一个国内人 (saberma) 在 github 上写的不错资源</title>
      <description>&lt;p&gt;推荐一个国内人 (saberma) 在 github 上写的不错资源。
&lt;a href="https://github.com/saberma/ruby-dev-bookmarks" rel="nofollow" target="_blank"&gt;https://github.com/saberma/ruby-dev-bookmarks&lt;/a&gt;&lt;/p&gt;</description>
      <author>fishinhouse</author>
      <pubDate>Thu, 27 Jun 2013 00:02:43 +0800</pubDate>
      <link>https://ruby-china.org/topics/12018</link>
      <guid>https://ruby-china.org/topics/12018</guid>
    </item>
    <item>
      <title>如何在 devel 模式下调整日 志级别</title>
      <description>&lt;p&gt;现在日志信息太多了，要找到自己打的日志信息太难了，不知大家有没有什么好办法。
如何调整成只显示自己用 logger.info 打出日志信息。&lt;/p&gt;</description>
      <author>fishinhouse</author>
      <pubDate>Mon, 10 Jun 2013 21:48:44 +0800</pubDate>
      <link>https://ruby-china.org/topics/11634</link>
      <guid>https://ruby-china.org/topics/11634</guid>
    </item>
  </channel>
</rss>
