一年 Steam 经验。
再试试 rvm cleanup
为什么不用 rvm uninstall/remove
?
我惯用的是 ~:username
。
我也好奇无前缀的网站要怎么解决用户名冲突:
Github 只有不活动用户会被回收 https://help.github.com/articles/name-squatting-policy/
Twitter: We reserve the right at all times (but will not have an obligation) to remove or refuse to distribute any Content on the Services, to suspend or terminate users, and to reclaim usernames without liability to you. https://twitter.com/tos
Facebook: 如果您为您的帐户或主页选择了一个用户名或类似的标识符,我们将保留在适当的时候将其删除或回收的权利(例如某商标所有人投诉用户名与用户的实际名字相去甚远)。 https://www.facebook.com/legal/terms
我现在更偏向针对云储存定制写逻辑。例如 S3 直接上传,七牛的图片裁剪和多媒体支持,多后端的上传库考虑的情况太多反而有些不顺手。
就是共用一个数据库的,逻辑独立。
进程管理我推荐用 foreman 导出系统管理配置(Ubuntu 是 Upstart)
Managing and monitoring your Ruby application with Foreman and Upstart http://michael.vanrooijen.io/articles/2011/06/08-managing-and-monitoring-your-ruby-application-with-foreman-and-upstart/
#6 楼 @alixiaomiao 好,加上了。
#3 楼 @springwq 这就要用 nginx 的 upstream 了。
upstream site-a {
server 127.0.0.1:5000; // 假设 site-a 开了一个进程监听 5000
}
upstream site-b {
server 127.0.0.1:6000; // 假设 site-b 开了一个进程监听 6000
}
server {
listen 80;
server_name site-a.com;
root /var/www/site-a.com/current/public;
try_files $uri/index.html $uri.html $uri @site-a;
location @site-a {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://site-a;
}
}
server {
listen 80;
server_name site-b.com;
root /var/www/site-b.com/current/public;
try_files $uri/index.html $uri.html $uri @site-b;
location @site-b {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://site-b;
}
}
thin 进程启动要另外管理。
server {
listen 80;
server_name site-a.com;
root /var/www/site-a.com/current/public;
passenger_enabled on;
}
server {
listen 80;
server_name site-b.com;
root /var/www/site-b.com/current/public;
passenger_enabled on;
}
新增一个黑名单表。
以后还是自录吧。
我有一张 orders 表 => 表结构是什么? 有一个全选功能 => 全选什么? 再对此订单进行操作该怎么写呢?=> 什么操作?
我试了 helper 里面可以用 request.ip()
。
如果要写成独立脚本,require 需要一个绝对路径:
# 假如放在 script/ 目录
require File.expand_path('../../config/environment', __FILE__)
去掉 require
rails runner path/to/filename.rb
详细使用说明看
rails runner
Why is it so many programmers love shitting on the hard work of other programmers? Most people are trying their best to build cool stuff.
— Robin Ward (@eviltrout) 2014 年 11 月 19 日
@eviltrout I’ve been guilty of it before (trolling turbolinks comes to mind) – gonna make an effort to stop
— Robin Ward (@eviltrout) 2014 年 11 月 19 日
如果你问这个问题,那么最好不用。