• deploy.rb

    $:.unshift(File.expand_path('./lib', ENV['rvm_path']))
    require "rvm/capistrano"
    
    set :user, "stephen"
    set :runner, "apps"
    set :group, "apps"
    
    set :application, "blog"
    set :rvm_ruby_string, "ruby-1.9.2-p290@global"
    set :rvm_path, "/home/stephen/.rvm"
    set :rvm_bin_path, "/home/stephen/.rvm/bin"
    set :rvm_trust_rvmrcs_flag, 1
    set :normalize_asset_timestamps, false
    
    set :scm, :git
    set :domain, "vm-192-168-11-11.shengyun.grandcloud.cn"
    set :repository,  "git://github.com/85636682/blog.git"
    set :branch, "master"
    
    set :deploy_to, "/home/apps/#{application}"
    set :deploy_via, :remote_cache
    set :git_shallow_clone, 1
    set :deploy_env, "production"
    set :rails_env, "production"
    set :scm_verbose, true
    set :use_sudo, false
    
    
    
    role :web, domain                          # Your HTTP server, Apache/etc
    role :app, domain                          # This may be the same as your `Web` server
    role :db,  domain, :primary => true # This is where Rails migrations will run
    
    namespace :deploy do
    
      task :init_shared_path, :roles => :web do
        run "mkdir -p #{deploy_to}/shared/log"
        run "mkdir -p #{deploy_to}/shared/pids"
        run "mkdir -p #{deploy_to}/shared/assets"
      end
    
      task :link_shared_files, :roles => :web do
        run "ln -sf #{deploy_to}/shared/config/database.yml #{deploy_to}/current/config/database.yml"
        run "ln -s #{deploy_to}/shared/assets #{deploy_to}/current/public/assets"
      end
    
      task :install_gems, :roles => :web do
        run "cd #{deploy_to}/current/; bundle install --without development test"
      end
    
      task :compile_assets, :roles => :web do
        run "cd #{deploy_to}/current/; bundle exec rake assets:precompile"
      end
    
    end
    
    # if you're still using the script/reaper helper you will need
    # these http://github.com/rails/irs_process_scripts
    
    # If you are using Passenger mod_rails uncomment this:
    # namespace :deploy do
    #   task :start do ; end
    #   task :stop do ; end
    #   task :restart, :roles => :app, :except => { :no_release => true } do
    #     run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
    #   end
    # end
    
  • @bluebu 你有 rails 下实际运用的示例么?看到点点网用得还 OK!

  • 哦,他是默认安装的嘛,我是说默认情况, @ywencn 但是我安装这个配置,全部搞好,还是访问不了,