No such file to load capistrano/ext/multistage




















Establishing this access for the first time can be a bit of a trick. In my last post, a basic intro to to running cap deploy was presented. Now, let's look at some more advanced scenarios. See Part 1 for the actual task definitions described here.

Multistage: Deploy to different environments such as testing vs. Multisite: Run many sites from a single code base. I'm a big fan of having an automated deployment process. It's really the web development analog to the "one step build process", as described in the Joel Test. In the past I have used various shell scripts to perform this task, but I have recently become a convert to Capistrano or "cap" for short. With Capistrano, uploading your code to the test server is as simple as typing cap deploy.

When you're ready to launch in production, it's just cap production deploy. From capify. It executes commands in parallel on all targeted machines, and provides a mechanism for rolling back changes across multiple machines.

In detail, here are the features that got me hooked. There's a lot more that cap can do, and I'll describe some more tricks in part 2 of this post. Atomic deployments with error checking.

Cap uses a set of symlinked directories, and the links are updated during the final step. It also won't allow a deployment to keep plowing ahead if an intermediate step fails. This command will check your local environment and your server and locate likely problems. If you see any error messages, fix them and run the command again. Once you can run cap deploy:check without errors, you can proceed! This will perform a deployment to your default stage, which is staging.

While these commands are performed, you will see a lot of output. Capistrano print all commands it runs on your server as well as their output, making it possible for you to debug any problems. Add the following to the section of your deploy. Capistrano shines by doing things more sophisticated than just copying files via SSH.

You can configure events and commands to run after the copying of files completes, such as restart a web-server or run a custom script. For an example, add the following code to your deploy. You can create tasks to perform operations on your server before, after or separately from your deployment.

This can be any sort of maintenance: restarting processes, cleaning up files, sending email notifications, running database migrations, executing scripts, and so on.

Our example includes two custom tasks. We need to add a hook for it in order for it to run:. This command tells Capistrano to execute our task after all deploy operations are complete. Since we have two server environments staging and production most likely you will want to bind your branches in Git to these environments, so that you can deploy staging branch to staging environment and master branch to production automatically.

Simply add the following line to your production. Now every time you run a cap deploy Capistrano will deploy code from your staging branch since staging is our default environment. Add a comment. Active Oldest Votes. Modify your gem file with below gems. Add this gems in development group. Improve this answer. Vishal Patidar Vishal Patidar 37 1 1 silver badge 4 4 bronze badges. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password.

Post as a guest Name. Email Required, but never shown.



0コメント

  • 1000 / 1000