#3 楼 @cassiuschen 开发环境应该和生产环境一致,如果生产环境用 docker,开发环境也应该用。
我倒是对生产环境用 docker 不太感兴趣,因为现在大多数情况还是跑在虚拟机上,直接提供 container 部署的也没几个。AWS 把 docker 跑在 EC2 上,优势是它的调度和扩展功能。
我觉得 docker 比较实用的地方是各种测试和打包环境。
我就用 Assets Pipeline,js 库手工下载放到 vendor。旁观 js 包管理变来变去,定出标准以后再找个 sprockets 扩展。
Vagrant + Bash 已经满足我的需求了。
原文介绍不妨写得明显些,我点进链接才知道是 2013 年的文章。
Visualizing Garbage Collection in Ruby and Python October 24th 2013
http://patshaughnessy.net/2013/10/24/visualizing-garbage-collection-in-ruby-and-python
#18 楼 @sharpx http://browserify.org/
Browserify lets you require('modules') in the browser by bundling up all of your dependencies.
Bower is alive, looking for contributors http://bower.io/blog/2015/bower-alive-looking-contributors/
目前建议手工下载到 vendor。
#22 楼 @so_zengtao ???什么问题?
<%= @posts.each do |post| %>
改成
<% @posts.each do |post| %>
会买,最好有电子版(epub/pdf/mobi)。
RUN whereis bundle
看看 bundle 在哪。
不说 Google 了,Ruby-Doc 站内搜索就有,不知道楼主怎么找的。
我不知道了。
CMD ["bash", "init.sh"]
把 init.sh 的
#!/bin/sh
换成
#!/bin/bash
看看。
没看到安装 bundler 的命令,bundler 不是 Ruby 自带的。
编程第一条法则:永远都是你的错 https://ruby-china.org/topics/28046
has_many :active_relationships,按约定应该找 ActiveRelationship,class_name 指定了要找的是 Relationship; has_may 的主体是 User,按约定关联的表应该用 user_id 做外键,foreign_key 指定了 follower_id。
顶楼的 Relationship 和 follower_id 不重复啊。
#6 楼 @kai209209 那么就把 a 当参数。
class A < ActiveRecord::Base
has_many :bs
def search_bs(params)
end
end
def show
@bs = a.search_bs(params)
end
#2 楼 @kai209209 那这个方法应该是 A 的实例方法。
那么 a.bs 为空的时候你期望这个方法怎么处理?
除了 view 和 db,应用还有没有别的耗时操作?