<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>angryfrog (angryfrog)</title>
    <link>https://ruby-china.org/angryfrog</link>
    <description/>
    <language>en-us</language>
    <item>
      <title>我安装配置了 gitlab，但访问时返回 500 错误</title>
      <description>&lt;p&gt;我安装并配置了 gitlab，其他地方都没什么问题。nginx 也配置成功了。但访问时返回 500 错误，
&lt;img src="//l.ruby-china.com/photo/2013/e22fa5e9b1e5ef5d3cb4ae43b497fca7.png" title="" alt=""&gt;&lt;/p&gt;

&lt;p&gt;访问日志如下：&lt;/p&gt;

&lt;p&gt;Connecting to database specified by database.yml
Creating scope :opened. Overwriting existing method Issue.opened.
Creating scope :of_projects. Overwriting existing method MergeRequest.of_projects.
Creating scope :closed. Overwriting existing method MergeRequest.closed.
Creating scope :public. Overwriting existing method Snippet.public.
Creating scope :private. Overwriting existing method Snippet.private.
Creating scope :fresh. Overwriting existing method ProjectSnippet.fresh.
Creating scope :non_expired. Overwriting existing method ProjectSnippet.non_expired.
Creating scope :expired. Overwriting existing method ProjectSnippet.expired.
Started GET "/users/sign_in" for 127.0.0.1 at 2013-11-14 08:16:59 +0800
Processing by Devise::SessionsController#new as HTML
  Rendered devise/sessions/_new_base.html.haml (3.7ms)
  Rendered devise/sessions/_oauth_providers.html.haml (0.1ms)
  Rendered devise/sessions/new.html.haml within layouts/devise (4.9ms)
  Rendered layouts/_head.html.haml (64.3ms)
Completed 500 Internal Server Error in 74ms&lt;/p&gt;

&lt;p&gt;ActionView::Template::Error (couldn't find file 'underscore'
  (in /home/git/gitlab/app/assets/javascripts/application.js:31)):
    5:     GitLab
    6:   = favicon_link_tag 'favicon.ico'
    7:   = stylesheet_link_tag    "application"
    8:   = javascript_include_tag "application"
    9:   = csrf_meta_tags
    10:   = include_gon
    11: 
  app/views/layouts/&lt;u&gt;head.html.haml:8:in `_app_views_layouts&lt;/u&gt;&lt;u&gt;head_html_haml&lt;/u&gt;&lt;strong&gt;1073825523124287833_36704500'
  app/views/layouts/devise.html.haml:3:in `_app_views_layouts_devise_html_haml&lt;/strong&gt;_2225179123726725323_33668600'&lt;/p&gt;

&lt;p&gt;Started GET "/static.css" for 127.0.0.1 at 2013-11-14 08:16:59 +0800&lt;/p&gt;

&lt;p&gt;ActionController::RoutingError (No route matches [GET] "/static.css"):
  vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13/lib/action_dispatch/middleware/debug_exceptions.rb:21:in &lt;code&gt;call'
  vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13/lib/action_dispatch/middleware/show_exceptions.rb:56:in&lt;/code&gt;call'
  vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/rack/logger.rb:32:in &lt;code&gt;call_app'
  vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/rack/logger.rb:16:in&lt;/code&gt;block in call'
  vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/tagged_logging.rb:22:in &lt;code&gt;tagged'
  vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/rack/logger.rb:16:in&lt;/code&gt;call'
  vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13/lib/action_dispatch/middleware/request_id.rb:22:in &lt;code&gt;call'
  vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/methodoverride.rb:21:in&lt;/code&gt;call'
  vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/runtime.rb:17:in &lt;code&gt;call'
  vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/lock.rb:15:in&lt;/code&gt;call'
  vendor/bundle/ruby/2.0.0/gems/rack-cache-1.2/lib/rack/cache/context.rb:136:in &lt;code&gt;forward'
  vendor/bundle/ruby/2.0.0/gems/rack-cache-1.2/lib/rack/cache/context.rb:245:in&lt;/code&gt;fetch'
  vendor/bundle/ruby/2.0.0/gems/rack-cache-1.2/lib/rack/cache/context.rb:185:in &lt;code&gt;lookup'
  vendor/bundle/ruby/2.0.0/gems/rack-cache-1.2/lib/rack/cache/context.rb:66:in&lt;/code&gt;call!'
  vendor/bundle/ruby/2.0.0/gems/rack-cache-1.2/lib/rack/cache/context.rb:51:in &lt;code&gt;call'
  vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/engine.rb:479:in&lt;/code&gt;call'
  vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/application.rb:223:in &lt;code&gt;call'
  vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/railtie/configurable.rb:30:in&lt;/code&gt;method_missing'
  vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/builder.rb:134:in &lt;code&gt;call'
  vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/urlmap.rb:64:in&lt;/code&gt;block in call'
  vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/urlmap.rb:49:in &lt;code&gt;each'
  vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/urlmap.rb:49:in&lt;/code&gt;call'
  vendor/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:552:in &lt;code&gt;process_client'
  vendor/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:632:in&lt;/code&gt;worker_loop'
  vendor/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:500:in &lt;code&gt;spawn_missing_workers'
  vendor/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:142:in&lt;/code&gt;start'
  vendor/bundle/ruby/2.0.0/gems/unicorn-4.6.3/bin/unicorn_rails:209:in &lt;code&gt;&amp;lt;top (required)&amp;gt;'
  vendor/bundle/ruby/2.0.0/bin/unicorn_rails:23:in&lt;/code&gt;load'
  vendor/bundle/ruby/2.0.0/bin/unicorn_rails:23:in `&lt;/p&gt;'&lt;p&gt;&lt;/p&gt;

&lt;p&gt;关于日志中 ActionView::Template::Error (couldn't find file 'underscore'的问题，我尝试 gem install underscore 了，但安装后这个问题依然存在。请问这些问题如何解决？rails 新手，感谢大家帮帮忙了。&lt;/p&gt;</description>
      <author>angryfrog</author>
      <pubDate>Thu, 14 Nov 2013 15:26:26 +0800</pubDate>
      <link>https://ruby-china.org/topics/15541</link>
      <guid>https://ruby-china.org/topics/15541</guid>
    </item>
    <item>
      <title>Rails 新手求助，如何两个 Rails 共用一个端口？</title>
      <description>&lt;p&gt;我在服务器上装了 gitlab 和 redmine。
现在两个项目是分别启动的，为了防止端口冲突，我起了 3000 和 3001 两个进程。&lt;/p&gt;

&lt;p&gt;但我觉得这样比较麻烦。有什么办法只启动一个进程使用一个端口来同时 run 这两个项目？&lt;/p&gt;

&lt;p&gt;对 rails 不熟悉，以前是搞 php 的。我能想到的办法就是用 nginx 在前面做反向代理，这样就可以给两个项目绑定不同的域名了。&lt;/p&gt;

&lt;p&gt;不知只用 ruby 和 rails 的情况下有什么比较文艺的办法解决这个问题？
貌似必须得给两个项目分别绑定域名，否则一个 ip 不能访问两个不同的项目。rails 自己的 server 没法做绑定域名等工作吧？&lt;/p&gt;</description>
      <author>angryfrog</author>
      <pubDate>Fri, 06 Sep 2013 17:54:22 +0800</pubDate>
      <link>https://ruby-china.org/topics/13932</link>
      <guid>https://ruby-china.org/topics/13932</guid>
    </item>
    <item>
      <title>请教大家如何转型成为 Ruby 的开发人员？</title>
      <description>&lt;p&gt;我做 php 6 年了，对于 linux+nginx+php+mysql+redis 都比较熟悉。&lt;/p&gt;

&lt;p&gt;现在非常喜欢 ruby，有想转型 ruby 程序员的想法。请各位给些建议。&lt;/p&gt;

&lt;p&gt;我自学了 ruby 的语法，通读了 matz 的那本书，也看了可以算是 ruby 设计模式的那本《ruby 元编程》。由于有其他语言的经验，对这本书中讲的东西大多都能理解。比如动态派发、method_missing 这些特性 php 也有。&lt;/p&gt;

&lt;p&gt;但我现在不会 rails，只能用 ruby 写一些脚本，类似于 python 的定位。&lt;/p&gt;

&lt;p&gt;请教大家几个问题：&lt;/p&gt;

&lt;p&gt;一、如果我放弃从前的一切，直接去一个公司面试全职 ruby 程序员，以我现在的水平（没有使用 ruby 开发过实际项目，不会 rails，只熟悉 ruby 的语法，用 ruby 写过一些小脚本），有可能成功吗？&lt;/p&gt;

&lt;p&gt;二、大家是如何成为 ruby 全职程序员的？也是从其它语言转过来的，还是 ruby 是你们的第一门实际投入工作的语言？&lt;/p&gt;

&lt;p&gt;三、就北京的全职 ruby 程序员，都是面向 web 领域开发的吗？有没有其他领域？比如桌面应用程序之类的，这关系到是否一定要学 rails。&lt;/p&gt;

&lt;p&gt;四、ruby+rails 的实际应用中，对于高并发的效果如何？只考虑跟 db 的简单交互，做一些增删改查，比如做个简单 blog，QBS 大概能到多少？&lt;/p&gt;

&lt;p&gt;五、大家用 ror 做 web 架构，都是用它自带的 http server 吗？有使用 nginx 或 apache+ror 的吗？&lt;/p&gt;

&lt;p&gt;六、ruby 程序员大概的薪水标准是多少？招 ruby 程序员的公司多不多？&lt;/p&gt;

&lt;p&gt;大家如果了解以上问题，请不吝赐教！在下感激不尽。因为我还是很犹豫，如果我放弃之前的一切去完全转型，可能会导致薪水掉的很低。这一点让我无法从容面对。&lt;/p&gt;

&lt;p&gt;斗胆说一下我是如何接触 ruby 的。&lt;/p&gt;

&lt;p&gt;1、2 年前，大家都开始流行学 python 来写一些服务器端脚本，php 毕竟主要专注 web，而 shell 更多还是擅长编写系统相关的脚本。对于日志分析之类的脚本 shell 还是有一定瓶颈。&lt;/p&gt;

&lt;p&gt;当时也是几个有些可笑的理由选择开始学习 ruby：&lt;/p&gt;

&lt;p&gt;一是觉得这名字很好听。
二是因为别人都学 python，想和别人不一样，自己尝试了下发现 ruby 的语法非常之优雅浪漫，所以选择了 ruby。但慢慢的发现我当初可能把 ruby 的定位搞错了。ruby 的定位貌似主要还是面向 web。而不是像 python 一样更加擅长编写脚本。我冒昧的说下自己的看法，如果说错了各位大牛可尽情批评：ruby 的特性很多，语言灵活的让人惊讶，可以 open class 动态修改类，可以很方便的实现 api 反射，但我认为如果滥用这些特性它的效率绝对是很低的。和 python 以及 php 同样是用 c 语言实现的脚本语言，它实现这么多特性必然是要有巨大性能开销才能做到。&lt;/p&gt;</description>
      <author>angryfrog</author>
      <pubDate>Thu, 06 Jun 2013 05:10:57 +0800</pubDate>
      <link>https://ruby-china.org/topics/11528</link>
      <guid>https://ruby-china.org/topics/11528</guid>
    </item>
    <item>
      <title>请教哪里有比较详细的 Ruby API 文档</title>
      <description>&lt;p&gt;首先我知道应该用 ri，但我的 ri 貌似有些毛病。
ri String 可以找到，但 ri String#gsub或ri String.gsub，就是找不到文档。&lt;/p&gt;

&lt;p&gt;我还知道可以用 API 反射，但 APi 反射我只能知道哪些对象有哪些方法，但不知道具体方法的作用和参数以及返回值之类的。&lt;/p&gt;

&lt;p&gt;所以想找个 web 文档，我搜了一些，但好像和用反射出来的一样，没有具体的方法详细介绍。&lt;/p&gt;

&lt;p&gt;请问各位知道哪里有比较详细的内部和外部常用库的 API 文档嘛？比如我想找 Net::HTTP 的相关资料就很难找到一个详细的。&lt;/p&gt;

&lt;p&gt;也许是我不会找，所以请大家赐教，另外如果有人知道我的第一个问题是怎么回事也请指教。先谢过了。&lt;/p&gt;</description>
      <author>angryfrog</author>
      <pubDate>Wed, 20 Mar 2013 06:50:05 +0800</pubDate>
      <link>https://ruby-china.org/topics/9582</link>
      <guid>https://ruby-china.org/topics/9582</guid>
    </item>
    <item>
      <title>请问 Hash 的 to_hash 到底有什么用？</title>
      <description>&lt;p&gt;a = {:a =&amp;gt; 1, :b =&amp;gt; 2, :c =&amp;gt;3}
b = a.to_hash&lt;/p&gt;

&lt;p&gt;p a.object_id
p b.object_id&lt;/p&gt;

&lt;p&gt;Hash 类的实例方法 to_hash 到底有何好处？我在看 learning ruby 这本书时，书中大概意思是表面上看起来没区别，但是降 a.to_hash 赋值给 b 后，b 并没有重新创建对象，a 和 b 的 object_id 是一样的，也就是说俩个对象属于别名关系。&lt;/p&gt;

&lt;p&gt;可是我测试，直接 b = a，a 和 b 的 object_id 也是一样的。&lt;/p&gt;

&lt;p&gt;所以实在不明白这歌方法到底有什么用处。另外 Array 类也有 to_a 方法。也有同样的问题。&lt;/p&gt;

&lt;p&gt;请赐教，非常感谢！&lt;/p&gt;</description>
      <author>angryfrog</author>
      <pubDate>Sun, 17 Mar 2013 22:41:36 +0800</pubDate>
      <link>https://ruby-china.org/topics/9513</link>
      <guid>https://ruby-china.org/topics/9513</guid>
    </item>
  </channel>
</rss>
