How to Restart a Rails App on Shared Hosting

阅读12次,收藏0次,顶0次,踩0脚 | 订阅者:ashchan | 来源:知易行难 | 文章作者: | 发表时间: 2008-12-02

I have several clients who have their rails sites hosted on shared servers. To make these sites actually running smooth is such a boring task, not to speak the maintenance nightmare. Most hosting companies don’t even provide good docs on how to restart your rails application (through ssh or capistrano of course). For example, on one [...]

Haml 2.0.4 Incompatible with Rails 2.2

阅读16次,收藏0次,顶0次,踩0脚 | 订阅者:ashchan | 来源:知易行难 | 文章作者: | 发表时间: 2008-11-28

I’ve recently updated several projects to Rails 2.2. The upgrade process was very smooth and fast, and everything seemed to be just fine until today: when I visited some pages of one project, I noticed some parts on serval pages were missing. What happened? I didn’t change any MVC code. A quick check led to this result: [...]

Rails I18N: ActiveRecord对象本地化

阅读17次,收藏0次,顶0次,踩0脚 | 订阅者:ashchan | 来源:知易行难 | 文章作者: | 发表时间: 2008-11-24

一直以来使用 Changing human attribute labels in Rails validation messages 中介绍的方法来本地化 ActiveRecord 字段名称。该方法简单实用,比方说有这样一个 User model: # == Schema Information # Schema version: 20081028111521 # # Table name: users # # id :integer not null, primary [...]

LG 电视画中画的缺点

阅读23次,收藏0次,顶0次,踩0脚 | 订阅者:ashchan | 来源:知易行难 | 文章作者: | 发表时间: 2008-11-23

家里用的 42 吋 LG 液晶电视的画中画功能比较弱,主要问题有两个: 1.小画面的位置不能设置,只能固定在右下角。看 NBA 的时候问题就出来了,比分和时间被挡住了,有图为证: 2.如果主画面和小画面的输入都是电视信号,则两个画面只能播放同一个频道!这真是太 BT 了,画中画使用最频繁的场景是看一个电视台频道的时候浏览其他频道的节目。这对于讨厌广告(有谁不讨厌呢)的人说很实用的功能,却完全被 LG 忽视了。Life is good, but not good enough. 不过除了 NBA,看电视也不多。现在的电视实在是被广告垃圾得一蹋糊涂。

服务器时间不准确引起backup_fu备份失败

阅读12次,收藏0次,顶0次,踩0脚 | 订阅者:ashchan | 来源:知易行难 | 文章作者: | 发表时间: 2008-11-22

升级一个站点为 Rails 2.2.2 后,使用 backup_fu 往 s3 备份数据,出现以下错误: The difference between the request time and the current time is too large. 服务器的时钟一向走得有些慢,看了一下,比实际时间晚了近 20 分钟!估计是这个原因引起的。改准时间试一下: sudo date -s "22 Nov 2008 15:29:00" 再次备份,OK了。

人靠衣装,Gmail有靓装

阅读20次,收藏0次,顶0次,踩0脚 | 订阅者:ashchan | 来源:知易行难 | 文章作者: | 发表时间: 2008-11-20

Gmail 支持 Themes 了。瞧我选的这个,还挺漂亮吧? 默认的是一款蓝色 Theme,要选择其他的,直接进入 Settings - Themes 设置即可。

Rails 难以部署?

阅读24次,收藏0次,顶0次,踩0脚 | 订阅者:ashchan | 来源:知易行难 | 文章作者: | 发表时间: 2008-11-15

David Heinemeier Hansson 最近开始写系列文章The Rails Myths,主要是对一些关于 Rails 的不实传言进行批驳。第一篇 [Myth #1: Rails is hard to deploy](Rails is hard to deploy),讲的是所有 Rails 开发者都非常关心的部署问题。 Rails 应用很难部署吗?我个人两年多的经验得出的结论是,可能会有些麻烦,但一点都不难。当然,我参与的一些项目都不大,日 PV 也没有几十万那种规模(不过那好象应该是扩展和伸缩的话题),但两年多的部署变化历程,现在看来其实非常简单: 起初,使用 Nginx + Mongrel Cluster,算是很经典的组合。这种方式结合 Capistrano 还是挺方便的。唯一稍嫌麻烦的是,如果服务器意外重启了,mongrel 实例遗留的 pid 文件会造成新实例...

HTPC Reloaded with Ubuntu 8.10

阅读28次,收藏0次,顶0次,踩0脚 | 订阅者:ashchan | 来源:知易行难 | 文章作者: | 发表时间: 2008-11-02

We have four computers in use at home currently: My Macbook Pro, on Leopard 10.5.5; My wife’s Thinkpad X40 laptop, on Windows XP sp2; My father’s PC, on Windows XP sp2, rarely used; Our HTPC in the living room, on Windows XP sp2; The Thinkpad X40 was almost 4 years old. I used install Ubuntu 5.04 on it together with [...]

Gmail Notifr Changelog

阅读28次,收藏0次,顶0次,踩0脚 | 订阅者:ashchan | 来源:知易行难 | 文章作者: | 发表时间: 2008-10-29

Gmail Notifr is an Open Source RubyCocoa Gmail Notifier for Mac OS X. View project detail here. You can fetch the source from: github: http://github.com/ashchan/gmail-notifr/tree/master Feedbacks are welcome! Leave a message in the comments area below. CHANGELOG 0.1.3 (Oct 29, 2008) “Open Inbox” goes to the proper url instead of the normal gmail url if hosted domains acco...

创建特定版本的Rails应用

阅读23次,收藏0次,顶0次,踩0脚 | 订阅者:ashchan | 来源:知易行难 | 文章作者: | 发表时间: 2008-10-27

Rails 2.2 马上就要登场。这部高速列车真是飞速驰进。先看看我都装了哪些版本的 Rails 了: phantom:~ james$ gem list rails *** LOCAL GEMS *** rails (2.2.0, 2.1.2, 2.1.1, 2.1.0, 2.0.2, 1.2.6) 不多不少呀。用 rails 命令创建一个新应用的时候,默认使用最新的版本。很多情况下要创建特定版本的应用,这时可以使用一个额外的参数来达到这个目的: rails _[version number]_ appname 如以下命令将创建一个 2.0.2 版本的应用: rails _2.0.2_ test_app