Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
tian
@chentianwen
VIP
NO. 1304 / 2012-03-06

0 Topics / 43 Replies
0 Followers
0 Following
0 Favorites
No GitHub.
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • String.methods.grep (/instance/){p $1} 为什么全部输出 nil at July 03, 2012

    建议你读一下源代码,看看别人是怎么用 block 的,先理解好基础先吧

  • String.methods.grep (/instance/){p $1} 为什么全部输出 nil at July 03, 2012

    ...我指的是你把$1放在一个 block 里,那里跟你用 grep 是不同的 context,$1是不可能获取到当前匹配的

  • 如何在 jruby 下后台启动 resque worker at July 03, 2012

    bundle exec 一下试试 PIDFILE=./resque.pid BACKGROUND=yes QUEUE=* jruby -S bundle exec rake environment resque:work

  • 快捷迅速的编辑器 at July 03, 2012

    sublime +1, vim +1

  • Ruby 中的函数式编程 at July 03, 2012

    用的很多啊,参见 http://khelll.com/blog/ruby/ruby-and-functional-programming/ 的解释

  • String.methods.grep (/instance/){p $1} 为什么全部输出 nil at July 03, 2012

    $1是指在当前 context 下的最后一个匹配。 你应该写String.methods.grep(/instance/){ |v| p v } 参见http://ruby-doc.org/core-1.9.3/Enumerable.html#method-i-grep

  • git commit -a 命令困惑 at July 03, 2012

    git commit -a 是把 unstaged 的文件变成 staged(这里不包括新建 (untracked) 的文件),然后 commit

  • nginx + unicorn 的 unicorn error 中常有 cache get / miss at June 01, 2012

    http://www.chentianwen.net/wordpress/2012/03/07/rails-3-cache-get-miss/

  • nginx + unicorn 的 unicorn error 中常有 cache get / miss at June 01, 2012

    If you get this from your error log, there might be two things you might look into:

    1. assets pipeline precompile

    2. cache_store is not properly set up for the environment (like staging and production)

  • 大家的 dotfiles 里都有些什么? at June 01, 2012

    depends on what you need la. I use the following things: .bashrc .caprc .gemrc .gitconfig .guard .irbrc .mongorc.js .monitrc .psqlrc .rdebugrc .rvmrc .sqliterc .vimrc

    still adding it

  • 还是 Rails 时间配置的问题 at June 01, 2012

    http://stackoverflow.com/questions/1166475/transform-datetime-into-local-time-in-ruby-on-rails

  • pjax 是什么以及为什么推荐大家用 at May 09, 2012

    印象中 pjax 不会减少后台负担。服务器还是要重新生成页面。所以 pjax 只是假象,它做到的就只是用 javascript 重新装载要刷新的部分。没有实际用途。

  • 类方法和对象方法分不清,求助 at March 29, 2012

    lineitems 是 activerecord 里面的 Assiciations 实例,可以调用类似 scope 的方法,但这个是实例方法。

  • Prev
  • 1
  • 2
关于 / RubyConf / Ruby 镜像 / RubyGems 镜像 / 活跃会员 / 组织 / API / 贡献者
由众多爱好者共同维护的 Ruby 中文社区,本站使用 Homeland 构建,并采用 Docker 部署。
服务器由 赞助 CDN 由 赞助
iOS 客户端 / Android 客户端 简体中文 / English