Skip to content


Subversion checkout URL

You can clone with
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

41 lines (27 sloc) 1.795 kB

RailsCasts Episode #377: Trinidad

Requires Ruby 1.9.2 or higher.

Commands used in this episode

ssh root@
adduser deployer
echo "deployer ALL=(ALL:ALL) ALL" >> /etc/sudoers
ssh-copy-id deployer@
cap deploy:install
cap deploy:setup
cap deploy:cold
bundle exec rails s trinidad -e production
cap nginx:setup
cap trinidad:setup
touch tmp/restart.txt
cap deploy trinidad:restart


  • Highline Version: If you are using JRuby 1.7 and receiving the exception NameError: cannot load Java class jline.ConsoleReader while running Capistrano commands then try running bundle update highline. This was fixed in Highline version to 1.6.14. See this issue for details.

  • SSH Agent Forwarding: If Capistrano hangs while deploying, check to see if the ssh_options[:forward_agent] = true is in the Capistrano config. This may not work as discussed here. Here are some solutions.

    • Authorize the server directly by generating an SSH key and setting it up as the deploy key.

    • Consider running Capistrano commands from Ruby MRI on your local.

    • Use an alternative deployment method such as "copy"

    • Try upgrading to JRuby 7 on your local machine, this has been reported to solve the issue but I have not tested it.

  • Not Reloading: I experienced an issue where running touch tmp/restart.txt on the server would not use the latest code. Unfortunately I was unable to reproduce this problem consistently enough to resolve it. If you experience this, please comment on this issue.

Jump to Line
Something went wrong with that request. Please try again.