Ruby China
  • 社区
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • 注册
  • 登录
Hooopo
@hooopo
管理员
第 8 位会员 / 2011-10-28

hooopo@gmail.com
nil
北京
160 篇帖子 / 3013 条回帖
360 关注者
0 正在关注
74 收藏
聪明的妖怪录下了唐僧的紧箍咒
打赏作者
GitHub Public Repos
  • oh-my-github-circles 47

    GitHub User Circle Generator Using GitHub Actions

  • hackernews-insight 21

    Hackernews Insight using TiDB Cloud

  • repo-track-pipeline 6

    🔄 A flexible open-source data pipeline for seamlessly syncing data from any repository to your da...

  • oh-my-github-pipeline 6

    🔄 A flexible open-source data pipeline for seamlessly syncing data from any github user to your d...

  • chatgpt-xiaoai 3

    小爱音箱集成LLM,SaaS 服务

  • repo-contributor-circles 1

    GitHub repo contributor circles generator.

  • ossinsight-x 1

    Automatically post trending repos to Twitter every day.

  • mi-service 1

    XiaoMi Cloud Service for mi.com

  • hooopo 0

  • streamlit-echarts-demo 0

    Demo for Streamlit ECharts component

More on GitHub
  • 概况
  • 话题
  • 回帖
  • 收藏
  • 正在关注
  • 关注者
  • Ruby 1.9.3-p125 is released at 2012年02月17日

    #14 楼 @bindiry 是哇 还是我的方法好:-) 这东西是从 master 分支 check 出来的 修复一个 bug 就会 +1

  • Ruby 1.9.3-p125 is released at 2012年02月17日

    #10 楼 @jinleileiking 你真能扯淡

  • Ruby 1.9.3-p125 is released at 2012年02月17日

    ruby -v ruby 1.9.3p129 (2012-02-17 revision 34654) [i686-linux]

  • Ruby 1.9.3-p125 is released at 2012年02月17日

    rvm reinstall 1.9.3-head

  • Rails route 匹配的问题 at 2012年02月16日

    #7 楼 @_samqiu 可以哇 其实还可以改表的主键:

    1.9.3p0 :016 > User.set_primary_key "email"
     => nil 
    1.9.3p0 :017 > User.find "hoooopo@gmail.com"
      User Load (0.5ms)  SELECT `users`.* FROM `users` WHERE `users`.`email` = 'hoooopo@gmail.com' LIMIT 1
    
    
  • Rails 在生产环境中 log 的产生问题 at 2012年02月16日

    #14 楼 @fsword 好吧 其实关闭不了延迟写日志不是 BuggeredLogger 职责调整导致的吗

  • Rails route 匹配的问题 at 2012年02月16日

    @tualatrix 这不是路由的问题。 你可以在 controller 里打印一下 params[:id] 应该是输出"1224hello"

    这应该是 ORM 的特性,比如 ActiveRecord:

    1.9.3p0 :006 > User.find 3
      User Load (0.2ms)  SELECT `users`.* FROM `users` WHERE `users`.`id` = 3 LIMIT 1
    1.9.3p0 :007 > User.find "3"
      User Load (0.2ms)  SELECT `users`.* FROM `users` WHERE `users`.`id` = 3 LIMIT 1
    1.9.3p0 :008 > User.find "3hello"
      User Load (0.2ms)  SELECT `users`.* FROM `users` WHERE `users`.`id` = 3 LIMIT 1
    

    可以这么转换一定是利用了 Ruby 的特性:

    1.9.3p0 :009 > "123hello".to_i
     => 123
    

    Ruby 的字符串转换成整数还可以用 Integer 方法,和 to_i 有一点区别:

    1.9.3p0 :011 > Integer("123")
     => 123 
    1.9.3p0 :012 > Integer("123hello")
    ArgumentError: invalid value for Integer(): "123hello"
    
  • 关于字符串的 split 问题 at 2012年02月16日

    #15 楼 @chitsaou 这东西文本越长准确率越高,所以一般网页判断的结果都很准确。。

  • Rails 在生产环境中 log 的产生问题 at 2012年02月16日

    #11 楼 @ashchan 那是什么引入的?

  • Rails 在生产环境中 log 的产生问题 at 2012年02月16日

    #8 楼 @tualatrix

    ActiveSupport::BufferedLogger#auto_flushing is deprecated. Either set the sync level on the underlying file handle like this:

    f = File.open('foo.log', 'w')
    f.sync = true
    ActiveSupport::BufferedLogger.new f
    

    Or tune your filesystem. The FS cache is now what controls flushing. ActiveSupport::BufferedLogger#flush is deprecated. Set sync on your filehandle, or tune your filesystem.

    上面是 3.2 的 changlog 大概的意思是,auto flushing 方法已经取消了。 现在想调节写 log 的 buffer 可以有两种方案: 1.设置文件打开方式:sync or async 2.调节操作系统的的 cache 来控制 fushing。。。这个我也不知道怎么调。。。:-)

  • Rails 在生产环境中 log 的产生问题 at 2012年02月16日

    bufferlog 在 rails2.3 就有的。

    ~/mine/rails -> (no branch) $ git co v2.3.4
    HEAD is now at a43ef24... Prepare for 2.3.4 release
    ~/mine/rails -> (no branch) $ git grep auto_flushing
    actionpack/test/template/benchmark_helper_test.rb:    logger.auto_flushing = false
    activesupport/CHANGELOG:* BufferedLogger#auto_flushing = N flushes the log every N messages. Buffers with an array instead of string. Disa
    
  • 关于字符串的 split 问题 at 2012年02月16日

    #11 楼 @fsword +1 外编码就是做这个的~ @413472212 关于内外编码可以看一下这个: http://rubyeye.herokuapp.com/articles/28-ruby1-9%E4%B9%8B%E5%AD%97%E7%AC%A6%E4%B8%B2%E5%86%85%E7%BC%96%E7%A0%81%E5%92%8C%E5%A4%96%E7%BC%96%E7%A0%81

  • 有没有什么 unicode 字体有 bold 样式的? at 2012年02月16日

    #4 楼 @ywencn pdfKit 或 prince 呀!

  • 有没有什么 unicode 字体有 bold 样式的? at 2012年02月15日

    #2 楼 @ywencn 你用什么生成 pdf

  • 有没有什么 unicode 字体有 bold 样式的? at 2012年02月15日

    不能每种语言指定一个字体?

  • 有关 "HTTP 协议是无状态的和 Connection: keep-alive 的区别" 的疑问 at 2012年02月15日

    http://zh.wikipedia.org/wiki/%E6%97%A0%E7%8A%B6%E6%80%81%E5%8D%8F%E8%AE%AE

  • 有关 "HTTP 协议是无状态的和 Connection: keep-alive 的区别" 的疑问 at 2012年02月14日

    有无状态是和 ftp 相比的吧

  • 大家谈谈什么时候开始喜欢编程,开始编程的啊。。。 at 2012年02月14日

    大三,听说学计算机的好找工作。。学了 Ruby

  • Heroku push 失败 at 2012年02月14日

    错误输出说的很清楚了 gemfile 里没加 thin

  • Ruby 和元编程的故事 - 第 0 回: 欲练神功,必先自废武功 at 2012年02月13日

    #5 楼 @ywencn +1

  • CounterCache 那个模块在更新操作时不会改变 count 的数量 at 2012年02月13日

    ActiveRecord 吗

  • rails 加载 gem 和自己项目代码的顺序? at 2012年02月13日

    http://rubyeye.herokuapp.com/articles/21-rails-%E5%88%9D%E5%A7%8B%E5%8C%96%E5%8A%A0%E8%BD%BD%E9%A1%BA%E5%BA%8F

  • 庆祝社区人数突破 1000!!! at 2012年02月13日

    8 号耶!

  • bundle update 和 bundle install 平时大家用哪个? at 2012年02月12日

    @zhangjingqiang @huacnlee @azhao

    而 bundle update 會重新產生整個 Gemfile.lock 檔案,更新所有 Gem 到最新版本。但是,一次升級太多套件,可能會造成除錯上的困難。因此會建議如果要升級,請執行 bundle update gem_name 一次升級一個套件。
    
    所以,再 Gemfile 里面,要再 gem 'foo' 的后面加上版本号嘛,以免一不小心 bundle update 带来的问题。
    

    这样有 N 个 gem 就要运行 N 次 bundle update..........

    问:为什么要一次升级一个 gem? 答:因为会一次报很多错误,难以排错

    问:为什么会一次报很多错误,难以排错? 答:因为很久没升级了,导致一次会升级很多 gem,并且很多 gem 都是旧的。

    问:为什么很久没升级了? 答:因为升级困难

    问:怎么困难? 答 1:锁定了版本号,要升级就需要知道每个 gem 的最新版本号,并且修改 gemfile....... 答 2:因为要运行 N 次 bundle update gemname.............. -------------------华丽的分割线------------------ 问:为什么要加版本号? 答:以免一不小心 bundle update 带来的问题

    问:源码控制是做什么的? 答:.... -------------华丽的分割线----------------------- 问:不锁定版本号导致开发机器和部署环境代码不一致怎么办?而且我遇到过这种情况。。 答:你的 bundle 使用方法错了。。

    所以,我觉得上面两种升级方案都不靠谱。而且理由很牵强。

    解决办法就是: 1.不锁定版本号 2.小步升级,频繁升级,fail fast 3.使用 SV 和 gemnasium 4.了解你使用的 gem

    这里是按照上面原则从 rails3.1.0rc4 升到 rails3.2.1,并且保持其他 gem 也是最新版本的一个实践: https://github.com/hooopo/rubyist/commits/master/Gemfile.lock

    再推荐一下这篇... http://rubyeye.herokuapp.com/articles/27

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