rails代码自动部署之webistrano

来源:互联网 发布:肯德基糖醋酱淘宝 编辑:程序博客网 时间:2024/05/23 23:52

webistrano 是 Capistrano的web版.

webistrano的相关资料: http://github.com/peritor/webistrano

Capistrano相关文档见  http://www.capify.org/index.php/Capistrano

 


在centos上使用该工程遇到的问题, 当使用该工具部署的时候,一旦代码里有中文的文件名的时候,总是提示svn: Can't convert string from 'UTF-8' to native encoding:

但是在控制台下手动svn co http://server-docnew/svn/repos/online_exhibition 没有问题. 网上给出的答案,几乎清一色的不适用.

后来这svn文档上看到下面一段话

Tip

For security reasons, the Subversion repository executes hook scripts with an empty environment—that is, no environment variables are set at all, not even $PATH or %PATH%. Because of this, a lot of administrators are baffled when their hook script runs fine by hand, but doesn't work when run by Subversion. Be sure to explicitly set environment variables in your hook and/or use absolute paths to programs.

看来是使用svn hook的时候,还需要将相应的环境变量加上才可以. 简单查阅了webistrano的源码,在
{RAILS_ROOT}/lib/webistrano/template/base.rb
#27行添加了如下代码
  default_environment["LC_CTYPE"] = "zh_CN.UTF-8"
-----------------------------------------------------------


原创粉丝点击