Ruby China
  • 社区
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • 注册
  • 登录
tian
@chentianwen
高级会员
第 1304 位会员 / 2012-03-06

0 篇帖子 / 43 条回帖
0 关注者
0 正在关注
0 收藏
未设置 GitHub 信息。
  • 概况
  • 话题
  • 回帖
  • 收藏
  • 正在关注
  • 关注者
  • String.methods.grep (/instance/){p $1} 为什么全部输出 nil at 2012年07月03日

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

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

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

  • 如何在 jruby 下后台启动 resque worker at 2012年07月03日

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

  • 快捷迅速的编辑器 at 2012年07月03日

    sublime +1, vim +1

  • Ruby 中的函数式编程 at 2012年07月03日

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

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

    $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 2012年07月03日

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

  • nginx + unicorn 的 unicorn error 中常有 cache get / miss at 2012年06月01日

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

  • nginx + unicorn 的 unicorn error 中常有 cache get / miss at 2012年06月01日

    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 2012年06月01日

    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 2012年06月01日

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

  • pjax 是什么以及为什么推荐大家用 at 2012年05月09日

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

  • 类方法和对象方法分不清,求助 at 2012年03月29日

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

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