Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
spike76
@spike76
Member
NO. 33805 / 2017-12-19

[email protected]
5 Topics / 268 Replies
14 Followers
2 Following
91 Favorites
Read the god damn error message!
No GitHub.
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • 哪个 Gem 的哪个功能是你认为的适合进行源码学习的? at April 02, 2022

    通过对这些 Gem 的功能片段的阅读,可以让源码新手能从易到难,循序渐进的去培养阅读源码的能力。

    这是个很理想的想法。多年前的我也有些这样的想法,想着先读完一个难度为 1 的源码,再去读难度为 2 的源码,逐渐继续,那么就能读下来难度为 100 的源码。但现实是复杂的,源码并不会标注自己是难度 1 还是难度 2,"难易"的评判是一个小马过河式的问题。

    我跟 5 楼和 7 的看法一样,真要读 gem 源码时,一般是在使用 gem 时产生了些疑惑,或者需要魔改 gem。把“阅读源码”本身当作阅读源码的目的,我自己的结果是,容易失去重心,最终只学到些没见过的语法糖和 API。

    如果楼主非要读 gem 源码,在掌握调试技能和熟悉 gem 公开 api 前提下,拉取 gem 的最初版本代码,配合他的单元测试,顺着测试单步调试,再难的 gem 都能看下来。当然,如果 gem 的单测写得不好,很可能说明没啥阅读价值。。。。

  • 回流招聘 “血泪史” at March 22, 2022

    老哥你们要是把大小周去掉,估计人就会多些。看起来是每两周只多上一天的班,但一年算下来得多上一个月的班。这得多少个年假才抵得过来啊

  • 中文圈有没有关于 ruby 和 rails 的 discord 服务 at March 21, 2022

    有过。个把月都没有人说话

  • 在使用 Rails 创建 API 框架时,开发模式总是报以下错误,总是某几个 controller 加载失败,有哪位大神知道这是什么情况,原生的怎么还没有 grape 稳定呢? at March 20, 2022

    顺便提一句,在定义类时,rails 不提倡使用“限定常量”的形式,而是使用“相对常量”的形式,否则对于 classic 的 autoloader,有时会产生诡异的类加载错误。因此 class Api::V1::Com::OptionsController 最好能写成

    module Api::V1::Com
      class OptionsContoller < Api::V1::Com::BaseController
      end
    end
    

    对于 Zeitwerk 的 autoloader,这两种写法没有区别

  • 在使用 Rails 创建 API 框架时,开发模式总是报以下错误,总是某几个 controller 加载失败,有哪位大神知道这是什么情况,原生的怎么还没有 grape 稳定呢? at March 19, 2022

    那就需要更多的信息了,坑可能在其他地方。rails 的常量自动加载机制已经变过几次了。随手试了下,这点代码信息在 rails 6 上没有复现问题。

  • 在使用 Rails 创建 API 框架时,开发模式总是报以下错误,总是某几个 controller 加载失败,有哪位大神知道这是什么情况,原生的怎么还没有 grape 稳定呢? at March 19, 2022

    错误信息就是答案

    Unable to autoload constant Api::V1::Com::OptionsController, expected /mnt/workspaces/rails_projects/reviewservice/app/controllers/api/v1/com/options_controller.rb to define it

    翻译:不能自动加载常量 Api::V1::Com::OptionsController,期望在 /mnt/workspaces/rails_projects/reviewservice/app/controllers/api/v1/com/options_controller.rb 中去定义这个常量。

    类名与文件层次不对应

  • 关于 Rails+Postgresql 的 Array 字段问题 at March 18, 2022

    rails_param 这个 gem 倒是内置了你要的效果,在 action 中使用param! :tag_ids, Array 就能把逗号分隔的参数转为数组。不过单纯为了这个功能而引入一个 gem 有点划不来,可以考虑自己手动封装个类似的方法。

  • 关于 Rails+Postgresql 的 Array 字段问题 at March 17, 2022

    写成这样也 ok。但为什么不直接传数组勒

  • Tesla backend is in Rails at March 10, 2022

    no wonder some parts are so slow...

  • Hello Ruby China from Russia at March 05, 2022

    @woto From what I see, there are few foreign developers in China because of the salary and language. And ruby is not very popular in China. As a result, there is only one or two recruitment information per month in RubyChina; you can see it here.

    The good news is that Chinese companies and the government don't care about your nationality. They will NOT ban you because of Russian citizenship.

    It seems you are a very seasoned developer, that's great; I think many employers would like to contact you if you can speak some Chinese. I know some companies spend years finding a good rails developer.

    A little more suggestion

    1. This forum supports markdown. Maybe you can use it to make your post more formal. And please put the important information about your skills and experiments in the post itself, not only in the replies.
    2. You can try to append "俄国资深全栈工程师寻远程工作" to your title, these Chinese characters mean "Russian seasoned full-stack developer looking for a remote job". This would make your post look more meaningful on the index page in my opinion.
    3. Usually, there are far more people in RubyChina on weekdays than on weekends. So you may wait until Monday or later to get more replies.
    4. You can try to look for some information in Japan's forum. They are very lacking developers, as I know.

    I hope here will help you.

  • Hello Ruby China from Russia at March 05, 2022

    This was the first time I knew that a European developer was looking for a job in China. It seems the world is changing 😀 .

    Although I can't help too much, I suggest you leave more information to help recruiters in RubyChina get to know you better, such as your working experience, skill stack, your Github, and so on.

  • 你们写程序是用 if 多,还是用 unless 多? at March 02, 2022

    我读 unless 的逻辑的时候脑子里会自动翻译成 if !xxx

  • 各位写代码时喜欢喝什么酒? at February 19, 2022

    醪糟

    边喝酒边敲代码,细想下还有点诗意啊

  • ActionText 让人头大!(===== 已解决 =====) at February 16, 2022

    要用文件系统来存附件的话,docker 容器应该要配个数据卷吧。

  • [成都] 孜点 (北京) 教育科技有限公司 招聘初级 Ruby 工程师 at February 14, 2022

    点赞。当初在 BOSS 上聊过,感觉老哥招人还是挺有诚意。不过因为 BOSS 的消息丢失没有看到面试消息(顺便吐槽下 BOSS 有时候真坑),于是去了另一家。没想到现在还在招人

  • rvm 被墙了怎么办 at February 10, 2022

    试试 asdf。我现在逐步用 asdf 取代 rvm,主要本地环境中的 python,nodejs,ruby 都需要个版本管理工具,恰好 asdf 都支持,正好统一了

  • Ruby 开发人员流失严重 at January 14, 2022

    排名改了之后俺也上榜了。激动😁

  • WSL2 中和 Linux 子系统双向同步的问题好像已经解决了! at January 13, 2022

    我当时也遇到了这个问题。重新设置 config.file_watcher = ActiveSupport::FileUpdateChecker 后,改了 ruby 代码也能正常同步,但是 js 文件一直不能自动编译。迁移到 wsl 内部文件系统就又快又正常了

  • Rails 查询优化小手段-SQL Caching at January 11, 2022

    谢了老哥,果然有这样的 gem

  • Rails 查询优化小手段-SQL Caching at January 11, 2022

    好总结。以前试过这种方案,觉得稍微有点 hack 就没这么整😀 。

    捉个虫:

    tag_ids = ActsAsTaggableOn::Tag.where(name: 'Rails').pluck(:id)
    

    应该是

    tag_ids = ActsAsTaggableOn::Tag.where(name: tag_name).pluck(:id)
    

    顺便问一下楼主:ActsAsTaggableOn::Tag 是在模型下建的命名空间么,还是用的 gem 的要求

  • 发现一个奇怪的 case:全局变量中的对象 class 竟然不相等 at November 25, 2021

    顺手在 rails 6.1.1 上试了下,完全没复现。一切正常

  • null at November 02, 2021

    老哥,我感觉你链接都贴错了

  • 求教,怎么能让 Class 可以访问和修改 modul 的变量? at October 28, 2021
    module Pipline
      def self.included(base)
        class << base
          attr_accessor :seg_column_name
        end
      end
    end
    
    class A
      include Pipline
      self.seg_column_name ='a'
    end
    
  • 现在学 Ruby 好,还是学 Go,在这里潜水十几年了 at October 23, 2021

    不懂就问:数仓具体是干啥的

  • 现在学 Ruby 好,还是学 Go,在这里潜水十几年了 at October 23, 2021

    楼上老哥这么一提,我倒是想起那个赌博老哥了,连载好多年,中途也是培训上岸,最后好像忍不住又亏回去了,大风大浪的故事。

    成年人全都要,先搞 rails 后搞 go

  • Foreman 是干什么的? 为什么不用 systemd ? at October 16, 2021

    没有必要了吧。除非你打算把 docker 当虚拟机用。。。我见过在 docker 里先装 linux,再装 rbenv,再装 ruby 的情况(当然还有一大堆依赖),整个镜像大概 4G。完全不理解这样搞的好处。

  • 关注了一个女 rubist at August 13, 2021

    没看到 ruby 代码勒?

  • 类似于这种语法是什么意思? at August 10, 2021

    https://ruby-china.org/topics/35195

  • Ruby 企业级架构师培训(实验班)暨 Rails on Cloud 开源 Contributer 招募 at August 04, 2021

    楼主敢写这么多东西出来,我还是相信楼主的水平

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