Note: The stack referred to in this article is no longer maintained and this article is kept purely for reference.
Welcome to the user guide for deploying to Engine Yard Cloud with the engineyard gem. For more information about Engine Yard's CLI, refer to the Engine Yard CLI User Guide.
To deploy an application from the CLI
-
Install the engineyard gem:
gem install engineyard
-
Switch to your local application directory that contains your git repository:
cd ~/my_application
-
Deploy your application:
ey deploy
If your application is running in multiple environments, append
-e environment_name
to disambiguate, for example,ey deploy -e production
. -
The first time you run the engineyard gem, enter your Engine Yard account credentials (email address and password) at the prompts. You only have to enter these once.
Your application is now deployed.
Common Errors
If you get the following error when deploying the application:
You will need to install OpenSSL and then rebuild eventmachine.
For .nix environments (including WSL):
sudo apt-get install openssl
gem install eventmachine
For Windows environments:
- Download and install OpenSSL
- Add it to the path as described on Installing OpenSSL on Windows 10 and updating PATH.
- Rebuild eventmachine by running
gem install eventmachine
If you have feedback or questions about this page, add a comment below. If you need help, submit a ticket with Engine Yard Support.
Hi, i'm getting the following error when installing the engineyard gem. Could you please look into this
$ gem install engineyard
ERROR: While executing gem ... (NoMethodError)
undefined method `call' for nil:NilClass
Hi Kranthi,
We've responded to the ticket you already had open with us in support. Please direct all further questions regarding your issue installing the engineyard gem to that ticket. Thanks!
Hi there,
I had to deploy some fixes to my server. Since the dashboard is not yet working, I had to try CLI.
First problem is that I don't have "~/my_application" directory. My application is at /data/my_application. In that directly, I tried running ey deploy. It doesn't really use the working directory as input, it listed the environments that I can deploy instead. It was helpful. But then when I run it, I got this problem that it doesn't have ssh-key:
ip-10-212-70-9 .ssh # ey deploy --environment='staging' --app='my_app' --account='my_account' --branch 'refs/heads/production'
Loading application data from EY Cloud...
Beginning deploy of ref 'refs/heads/production2' for 'my_app' in 'Staging' on server...
Running command on deploy@ec2-xxx-xx-xxx-xxx.compute-1.amazonaws.com.
Error encountered during deploy.
Failed deployment recorded in EY Cloud
Authentication Failed: Please add your environment's ssh key with: ssh-add path/to/key
I tried doing ssh-add to the app's ssh key to access github, but it doesn't work. I thought my environment is the most typical engineyard environment. But this instruction seems to not support that. Would you please give some pointers?
Thanks in advance.
Thanks for the great support. They pointed out that I am actualy to install and use the EngineYard gem CLI on my local machine. Once I know that, it went very smoothly and my app is deployed.
Thank you very much for your feedback. We have updated this page to clarify that the engineyard gem runs on your local machine.
Small comment. The doc above says that ey logout will take down the maintenance page. I believe it will log you out instead.
Hi Tom, thanks for the catch! We appreciate the feedback. kjm
Hi there! is there any way through the CLI tool or maybe another way, to display the Maintenance Page to all the visitor, except to the ones accessing from an specific IP? Thanks in advance for your time!
+1 for Agustin suggestion
Hi Agustin, Tom,
Our CLI does not have this capability at present (nor does the dashboard). Generally speaking, you should be able to push new code changes to a staging environment and preview them there before deploying live (so you can see the changes without affecting users). However, if that isn't sufficient for your needs, I recommend opening a feature request at our feature request forums.
https://support.cloud.engineyard.com/forums/30086-feature-requests
Do you have a client tool for PHP deployments for is the this a Ruby only solution?
Hi Fritz,
While the
engineyard
gem is really focused on deploying Ruby applications, it should still be possible to use it to deploy a PHP app. Features related to migrations and database operations will likely not work but most of the other features should still be very useful for a PHP developer.Note that to use the CLI, you will need to have Ruby installed and then you should be able to install it with
$ (sudo) gem install engineyard
. After that, just runey help
to see what commands are available to you.Thanks,
Evan Machnic
Hi all,
Please give me sample code for mongoid.yml and ey.yml for engine yard.
Thanks & Regards
Sundeep
FYI: there is no mention of
ey rollback
Thanks, Matt. What we really need is automated push of the https://github.com/engineyard/engineyard/blob/master/README.rdoc to this doc! :)
thanks again, kjm
After installing the 'engineyard gem' and issued the 'ey deploy' command, I got the following
Loading application data from Engine Yard Cloud...
Using current HEAD branch "master".
The environment 'kodefugeEnv' does not have a master instance.
Any clue?
if you find the output is
"No application found matching remotes:"
you should provide the environment arguments
i.e. # ey ssh -e NAME
Another cause of the "No application found matching remotes:" error is your git remote name. git/Github don't care about case sensitivity, but the engineyard gem does.
For example, this wasn't working for me:
origin https://github.com/sean/my-neat-repo (fetch)
origin https://github.com/sean/my-neat-repo (push)
I could happily push/pull with that Github remote, but the actual project repo name was uppercase:
origin https://github.com/sean/My-Neat-Repo (fetch)
origin https://github.com/sean/My-Neat-Repo (push)
:tired_face:
Is `ey-core` a drop-in replacement for the `engineyard` gem referenced? When I try to install `engineyard` on modern Ruby I encounter "key not found: :ciphers".
Hello Tyler,
Yes you are indeed correct on this, `ey-core` is an updated version of the engineyard gem. Therefore we do recommend utilizing `ey-core` instead of `ey` in the new chef customizations and in deployments.
You can find more information regarding this gem at https://github.com/engineyard/core-client-rb
Pasan