rails代碼自動部署之webistrano

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"
-----------------------------------------------------------


發佈了54 篇原創文章 · 獲贊 12 · 訪問量 15萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章