Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
李福中
@lifuzho
VIP
NO. 1181 / 2012-02-24

上海
1 Topics / 91 Replies
7 Followers
2 Following
3 Favorites
GitHub Public Repos
  • capistrano-faster-rails 7

    Deploy your Ruby On Rails project with Capistrano even faster

  • dev_conf 0

  • stone 0

    The personal blog power by Ruby On Rails

  • book 0

    个人认为对技术提升很不错的书

  • FEBS-Shiro 0

    Spring Boot 2.1.3,Shiro1.4.0 & Layui 2.5.4 权限管理系统。预览地址:http://49.234.20.223:8080/login

  • paperclip-qiniu 0

    Simple gem that makes paperclip save the attachments to qiniu.com

More on GitHub
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • rails 应用使用已有数据库报错 at May 17, 2023

    @lobb 安装 Ruby 时,使用自己编译的 openssl 试试。

    wget https://codeload.github.com/openssl/openssl/zip/refs/heads/OpenSSL_1_1_1-stable -O openssl-1.1.1.zip
    unzip openssl-1.1.1.zip
    cd openssl-OpenSSL_1_1_1-stable
    sudo ./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl shared zlib
    make -j8
    sudo make install
    rvm reinstall 3.0.0 -C --with-openssl-dir=/usr/local/ssl
    
  • Rails On K8S 使用两周年的经验与教训 at February 15, 2023

    巧啊,场景和技术栈跟我们公司很像,都是 SaaS 系统,也是后端 Rails+MySQL,前端 jQuery+Bootstrap,并且也部署在阿里云青岛区。报表我们也准备用 ClickHouse 的,最终还是用了 StarRocks,写入并发过高还是有问题,复杂的 join 查询效果也不理想。我们系统项目代码快 40 万行了,目前还是传统 cap 部署,之前瓶颈一直都在数据库,分库分表后就稳定了。应用流量比较稳定,工作日均请求 4000w+,CPU 使用率经常保持在 50%~70%,没有明显的流量激增,也没怎么搞过突发扩容。现在有新的团队,准备搞容器化了。

  • 怎样使 Sidekiq 的任务一个一个执行 at September 16, 2022

    使用sidekiq-limit-fetch也行: https://github.com/deanpcmad/sidekiq-limit_fetch

  • 上海 Ruby Tuesday 求反馈 📝 at March 24, 2021

    发个问卷调查链接出来呗

  • 使用 Capistrano 部署,时间超长,原因是什么? at June 30, 2020

    试试这个看看: https://github.com/ifool/capistrano-faster-rails

  • [上海] GOAT Group 招聘 Ruby 后端工程师程序员 1 名 at December 24, 2019

    这是指明了要挖 SAP、流利说 的墙角啊 😆

  • python 中类似 rb 中 yeild+block 的方法 at November 14, 2019

    Ruby 中的 yield + block 像 Python 的 with 用法

  • 一直没弄懂的一个地方,String === String 恒返回 false? at October 10, 2019

    看一下这篇文章吧,讲得比较全面 https://blog.arkency.com/the-equals-equals-equals-case-equality-operator-in-ruby/

    Class / Module

    mod === obj #→ true or false

    === returns true if obj is an instance of mod or one of mod’s descendants. Of limited use for modules, but can be used to classify objects by class.

    Basically implemented as

    obj.kind_of?(mod)

    所以:

    Module === Module # => true
    Class === Class # => true
    Object === Object # => true
    String === String # => false
    
  • Rails 5.2 新功能详解 at May 03, 2018

    赞! 👍 ,还有个小 typo 😄 : file_filed => file_field

  • 项目每次重新部署后,第一次打开页面都很慢,有时甚至报 504 超时 at April 20, 2018

    @lengcb 静态资源要用 nginx 处理,看看 Rails 对应环境 (config/environments/***.rb) 的配置是不是下面这样的

    Rails.application.configure do
      config.cache_classes = true
      config.eager_load = true
      config.assets.compile = false
      config.serve_static_files = false
    end
    

    部署时配置 puma 的重启方式为 phased restart (貌似和 preload_app! 有冲突)。

  • [长沙 待遇优厚] 招聘 Ruby 工程师 at January 23, 2018

    @return 有没有项目介绍?待遇贴出来看看有多优厚吧? 😆

  • [北京&上海&广州&深圳&武汉] DJI 大疆创新招聘 Ruby 工程师 / Team Leader (saberma 内推 15-40k) at May 11, 2017

    没想到公司真的奖了我一台宝马,这个 +1 👍

  • 如何评价这样一位开发者? at March 12, 2017

    只有我一个人发现了是 has_and_belongs_to_many 而不是 has_many_and_belongs_to 吗? 😎

  • ExceptionTrack - 捕捉 Rails 应用运行期的异常,并存储到数据库 at February 21, 2017

    @huacnlee 改了 gemspec 之后确实可以用了,不过 will_paginate 和 kaminari 有冲突 😂

  • ExceptionTrack - 捕捉 Rails 应用运行期的异常,并存储到数据库 at February 20, 2017

    @huacnlee 这么好的东西从 Rails 4.2 开始支持的啊,能从 Rails 4.0 开始支持吗? 😆

  • [长沙] Kdan Mobile 招聘 Ruby on Rails 工程师 (9K~15K) at January 05, 2017

    公司介绍和职位诱惑可以接地气点噻,至少也可以贴个官网链接吧。 https://www.kdanmobile.com/zh-cn/

    长沙使用 Ruby 的公司实在太少啦!顶一下湖南的公司。

  • [佛山] 楼兰电商诚聘 Ruby 工程师 8 名 (10K ~ 25K) at October 22, 2016

    👍

    assert excellent_group.will_be_sucessful
    assert excellent_group.members.all?(&:will_be_successful)
    
  • [长沙] 万流网招聘 Ruby on Rails,Node.js 工程师,前端开发工程师 at May 14, 2016

    顶一个长沙的 Ruby 工作。

  • 元编程 基础方法整理 at May 23, 2015

    关于 BINDINGS,楼主的最后 3 行输出结果应该分别是

    puts(eval("@mystr << @@x", ob1.getBinding)) #=> ob1 string some other value
    puts(eval("@mystr << @@x", ob2.getBinding)) #=> ob2 string some other value
    puts(eval("@mystr << @@x", ob3.getBinding)) #=> ob3 string some other value
    

    因为当 @@x = " some other value" 在顶层环境执行完后,相当于执行了 Object.class_variable_set("@@x", "some other value"),而 MyClass、MyOtherClass 和 Object 都处于同一个 Class Tree 中,它们都会共享父类的类变量,此时 MyClass.class_variable_get("@@x") 和 MyOtherClass.class_variable_get("@@x") 都相当于是 Object.class_variable_get("@@x")。

  • MySQL 数据库 varchar 到底可以存多少个汉字,多少个英文呢?我们来搞搞清楚 at March 31, 2015

    @ibugs 文章最后是不是笔误,应该是在 gbk 状态下,汉字最多可以存 32766 个字符,英文也为 32766 个字符吧。

  • 闭包的写法应该用哪种 at February 25, 2015
    for (var i = 0; i < 10; i++) {
        setTimeout(function(a) {
            console.log(a);
        }, 1000, i);
    }
    
  • [2014 年][10 月 20 日~11 月 12 日] 七牛三周年嘉年华,感恩有你! at October 21, 2014

    71

  • 网站出现 This website is under heavy load 怎么破 at August 30, 2014

    出现 website is under heavy load 这种情况一般是当前请求过多,Passenger 处理不过来,尤其是在刚刚部署完,Passenger 重启的时候这个问题会比较明显。在有比较多的文件上传、数据导出的时候,也会严重阻塞 Passenger 对其它请求的处理,也比较容易导致 website is under heavy load。所以我的建议是:

    1、在config/environments/production.rb中,设置

    config.assets.compile = false
    

    理由请见: http://stackoverflow.com/questions/8821864/config-assets-compile-true-in-rails-production-why-not

    2、限制 Nginx 文件上传的大小。

    3、将 Passenger 换成 Unicorn,进行热部署,减少刚部署完成后大量请求阻塞,Unicorn 和 Nginx 的具体配置请参见: https://ruby-china.org/topics/12033

  • Rails 4 on rainbows production 模式下很慢 at August 23, 2014

    你这个可能会有很多原因,比如你页面中有连接 Redis,但一直连接不上,这时就会卡住 5 秒(Redis 的默认超时时间就是 5 秒)。或者也有可能是你 production 环境下 Rainbows 开的内存不够大,导致其频繁杀死、重启 Rainbows 进程,从而导致页面输出比较卡(ps:Rainbows 我没有用过,只用过 Unicorn)。以及其它原因等等。

  • 就是 user 表中 有六个字段,任意符合其中两项的就提出来,逻辑怎么写 at August 01, 2014

    在 MySQL 中,如果条件成立,则返回 1,不成立则返回 0,所以可以这样做:

    select * from users where ( (name like '%王%') + (phone = '15888882222') + (age > 15) + ...) >= 2;
    
  • 'APIController' is not a supported controller name at May 14, 2014

    在 config/initializers/inflections.rb 中加入如下代码就可以了

    ActiveSupport::Inflector.inflections do |inflect|
      inflect.acronym 'API'
    end
    
  • 谁遇到过 unicorn 传不回数据导致超时的问题 at November 02, 2013

    #12 楼 @ShiningRay 实在是找不到原因,临时用了 Thin,网上搜索出来的答案显然都和我们遇到的情形不一样。我中间重启过 nginx 和 unicorn 多次,有一次竟然可以了,之后再重启就再也不行了,非常诡异。

  • 谁遇到过 unicorn 传不回数据导致超时的问题 at November 02, 2013

    昨晚正好遇到和楼主同样的问题,nginx 搭配 unicorn 一直报 504 Gateway Timout 的错,换成 Thin 之后立马好了。unicorn server 和 nginx 的日志显示都很正常,设置超时什么的也不起作用,不知道是何原因。

  • 北大的公开课上线了啊,本月底开课,纯中文,适合基础差的同学恶补 at September 19, 2013

    好东西,正好适合我等基础差、英语差的菜鸟。

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