Over the life of the Internet I have created innumerable web sites (many corporate 'internal' sites) and many have become extinct. After discovering Ruby-on-Rails (around 2006) I have become a Serial Rails Developer. When asked "What have you done?" I am at a loss for more than the site on which I most recently worked. This is my personal inventory of Rails Sites (simply as a memory aid for me).
Cap Deploy rollback on Net::SSH::Authentication error
I use Nitrous as my primary development environment. The ability to work on any one of a number of projects at any time and from anywhere is simply too convenient to overlook. {As a matter of fact, I am writing this on a Nitrous box from a hospital bed!}
On a site I have been maintaining and continuously updating (on a drogo - Ruby/Rails Nitrous box), my capistrano deploy script failed one day.
One day my Capistrano deploy for the site returned
[deploy:update_code] exception while rolling back: Capistrano::ConnectionError, connection failed for: ...
The error message was a bit confusing because it pointed to SSH authentication
| #Model | |
| @user.should have(1).error_on(:username) # Checks whether there is an error in username | |
| @user.errors[:username].should include("can't be blank") # check for the error message | |
| #Rendering | |
| response.should render_template(:index) | |
| #Redirecting | |
| response.should redirect_to(movies_path) |
| module Bacon | |
| class Context | |
| def expect(obj) | |
| Bacon::Should.new(obj) | |
| end | |
| end | |
| end |
A previously working Rails app, after a successful Capistrano deploy cycle, stops responding and the server returns the http status code 504.
I was able to successfully access the Droplet by way of SSH. Looking at the logs I noticed the unicorn server was having trouble [re]starting.
tail -f /home/unicorn/log/unicorn.log
| #!/usr/bin/env ruby | |
| # Author : Emad Elsaid (https://github.com/blazeeboy) | |
| require 'json' | |
| require 'open-uri' | |
| require 'uri' | |
| require 'net/http' | |
| CODE_LIMIT = 10 | |
| $url = "https://eval.in/" | |
| $languages = { |
| require 'webrick' | |
| Port = 3000 | |
| Directory = Dir::pwd | |
| WEBrick::HTTPServer.new( | |
| Port: Port, | |
| DocumentRoot: Directory | |
| ).start |
| #!/usr/bin/env ruby | |
| # gem install sinatra --no-document | |
| # gem install github-markdown --no-document | |
| # usage: ruby markedown.rb then, in Nitrous, simply select 'Preview -> Port 3000' on the menu | |
| require 'sinatra' | |
| require 'github/markdown' | |
| # Set port for compatability with Nitrous.IO | |
| configure :development do |
