当前位置: 首页 > 工具软件 > Moonshine > 使用案例 >

moonshine部署rails项目

危寒
2023-12-01

moonshine部署项目——rails 3
1. 在项目目录下安装插件:
$ rails plugin install git://github.com/railsmachine/moonshine.git
2. 生成配置文件
$ rails generate moonshine
会生成config/moonshine.yml
3. 在Gemfile中加入:
gem 'shadow_puppet'
gem 'capistrano-ext'
这两个为moonshine需要依赖的gem
4. 编辑moonshine.yml和deploy.rb


5. 部署安装
$ cap deploy:setup
6. 安装依赖包,部署项目
$ cap deploy

过程中出现问题:
1. 服务器未自动安装subversion,手动安装
2. svn中开始有Gemfile.lock,删除后出错
3. 在config/deploy.rb中添加:
task :copy_configuration do
  run "cp #{shared_path}/config/*.* #{release_path}/config/"
end

将shared/config下的文件覆盖到current中
after "deploy:update_code", :copy_configuration

 类似资料: