• 假的 Redis,fakeredis at 2011年12月01日

    #8 楼 @Rei thx!

  • 假的 Redis,fakeredis at 2011年12月01日

    #5 楼 @Rei

    无法下载 http://downloads-distro.mongodb.org/repo/ubuntu-upstart/dists/dist/Release  Unable to find expected entry  10gen/source/Sources in Meta-index file (malformed Release file?)
    
    E: 有一些索引文件不能下载,它们可能被忽略了,也可能转而使用了旧的索引文件。
    
  • 轻量级的好多呀 不过都需要自己去根据实际需求去衡量 1.system 2.fork 3.eventmachine

  • 假的 Redis,fakeredis at 2011年12月01日

    #3 楼 @Rei 装 mongodb 好难啊 我的还没装上.........55555

  • 使用了 bundler 就不需要 gemset 了呀 gemset 主要用于 Rails2

  • #7 楼 @huacnlee 补充: 4.挂了的时候能看到/usr/local/lib/ruby/gems/1.8/gems

  • #15 楼 @huacnlee

    Internal server error
    Passenger encountered the following error:
    The application spawner server exited unexpectedly: No space left on device
    
    Exception class:
    PhusionPassenger::Railz::ApplicationSpawner::Error
    Backtrace:
    #   File    Line    Location
    0   /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/railz/application_spawner.rb   218 in `start'
    1   /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/spawn_manager.rb   262 in `spawn_rails_application'
    2   /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/abstract_server_collection.rb  126 in `lookup_or_add'
    3   /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/spawn_manager.rb   256 in `spawn_rails_application'
    4   /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/abstract_server_collection.rb  80  in `synchronize'
    5   /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/abstract_server_collection.rb  79  in `synchronize'
    6   /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/spawn_manager.rb   255 in `spawn_rails_application'
    7   /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/spawn_manager.rb   154 in `spawn_application'
    8   /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/spawn_manager.rb   287 in `handle_spawn_application'
    9   /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/abstract_server.rb 352 in `__send__'
    10  /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/abstract_server.rb 352 in `main_loop'
    11  /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/abstract_server.rb 196 in `start_synchronously'
    12  /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.11/bin/passenger-spawn-server   61  
    Powered by Phusion Passenger, mod_rails / mod_rack for Apache.
    
  • 是不是被你们访问挂了? 据说他们喜欢用 Rails1.2

  • #9 楼 @Rei 这消息不是很 out 吗

  • 没看懂你的需求..

  • Iconv Code Review at 2011年11月28日

    好吧

  • 这是个大 Bug!

  • Iconv Code Review at 2011年11月28日

    我觉得大家都在误用 force encoding 呀 force encoding 只改变字符的编码标记,并不真正改变字符的编码 encode 才改变编码,但是必须知道本来是什么编码

  • Iconv Code Review at 2011年11月28日
    require 'rchardet19'
    
    def encode(string)
      cd = CharDet.detect(string)
      if cd.confidence > 0.6
        string.force_encoding(cd.encoding)
      end
      string.encode("utf-8", :undef => :replace, :replace => "?", :invalid => :replace)
    end
    
  • https://github.com/rails/rails/issues/2963 我也觉得这个错误提示不是很友好...

  • #16 楼 @nowazhu 我也觉得这个测试不靠谱,,因为他的测试数据是随机产生的,每个 store 的 miss 的数量不相同..

  • 咦 好像我搞错了,囧 rz

  • #2 楼 @lgn21st 在继承的时候是有区别的 https://github.com/rails/rails/blob/master/activerecord/lib/active_record/callbacks.rb

    # == Inheritable callback queues
    #
    # Besides the overwritable callback methods, it's also possible to register callbacks through the
    # use of the callback macros. Their main advantage is that the macros add behavior into a callback
    # queue that is kept intact down through an inheritance hierarchy.
    #
    #   class Topic < ActiveRecord::Base
    #     before_destroy :destroy_author
    #   end
    #
    #   class Reply < Topic
    #     before_destroy :destroy_readers
    #   end
    #
    # Now, when <tt>Topic#destroy</tt> is run only +destroy_author+ is called. When <tt>Reply#destroy</tt> is
    # run, both +destroy_author+ and +destroy_readers+ are called. Contrast this to the following situation
    # where the +before_destroy+ method is overridden:
    #
    #   class Topic < ActiveRecord::Base
    #     def before_destroy() destroy_author end
    #   end
    #
    #   class Reply < Topic
    #     def before_destroy() destroy_readers end
    #   end
    #
    # In that case, <tt>Reply#destroy</tt> would only run +destroy_readers+ and _not_ +destroy_author+.
    # So, use the callback macros when you want to ensure that a certain callback is called for the entire
    # hierarchy, and use the regular overwriteable methods when you want to leave it up to each descendant
    # to decide whether they want to call +super+ and trigger the inherited callbacks.
    #
    # *IMPORTANT:* In order for inheritance to work for the callback queues, you must specify the
    # callbacks before specifying the associations. Otherwise, you might trigger the loading of a
    # child before the parent has registered the callbacks and they won't be inherited.
    
  • 两种写法不等价吧

  • 这种牛人是怎样炼成的? at 2011年11月27日

    #2 楼 @fredwu 我崇拜 Aaron Patterson, Ilya Grigorik 和 Loren Segal

  • heroku db:pull
    

    可以把 Heroku 的数据库导入到本地开发环境

    ---edit--- db:pull 和 db:push 就是 lgn21st 说的 tab gem 提供的.. ps:回帖没有删除功能?

  • 者也的代码还维护吗 at 2011年11月27日

    @huacnlee 如果 patch 版本不能保证 API 兼容的话还是不要用他的 gem 了... 我找了几个实际的项目,看看他们的 Gemfile: https://github.com/intridea/omniauth/blob/master/omniauth.gemspec https://github.com/plataformatec/devise/blob/master/Gemfile https://github.com/rails/rails/blob/master/Gemfile

    Bundler 的 FAQ:http://gembundler.com/rationale.html

    FAQ: Why Can't I Just Specify Only = Dependencies?
    
    Q: I understand the value of locking my gems down to specific versions, but why can't I just specify = versions for all my dependencies in the Gemfile and forget about the Gemfile.lock?
    
    A: Many of your gems will have their own dependencies, and they are unlikely to specify = dependencies. Moreover, it is probably unwise for gems to lock down all of *their* dependencies so strictly. The Gemfile.lock allows you to specify the versions of the dependencies that your application needs in the Gemfile, while remembering all of the exact versions of third-party code that your application used when it last worked correctly.
    
    By specifying looser dependencies in your Gemfile (such as nokogiri ~> 1.4.2), you gain the ability to run bundle update nokogiri, and let bundler handle updating **only** nokogiri and its dependencies to the latest version that still satisfied the ~> 1.4.2 version requirement. This also allows you to say "I want to use the current version of nokogiri" (gem "nokogiri" in your Gemfile) without having to look up the exact version number, while still getting the benefits of ensuring that your application always runs with exactly the same versions of all third-party code.
    
  • 者也的代码还维护吗 at 2011年11月27日

    我的意思是不指定版本也同步(当然如果你的 Gemfile.lock 如果没有 check 到版本库,那是你 bundle 使用的问题..) cache 到 vendor 与否是另外一个话题了