OpenSSL::SSL::SSLError (SSL_connect returned=1 errno=0 state=SSLv3 read server hello A: tlsv1 alert internal error)

require 'openssl'
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE

# Mechanize
m = Mechanize.new
m.agent.http.verify_mode = OpenSSL::SSL::VERIFY_NONE
page = m.get(url)

Capistrano Rails console

# cap production rails:console
namespace :rails do
  desc "Run the console on a remote server."
  task :console do
    on roles(:app) do |h|
      execute_interactively "RAILS_ENV=#{fetch(:rails_env)} bundle exec rails console", h.user
    end
  end

  def execute_interactively(command, user)
    info "Connecting with #{user}@#{host}"
    cmd = "ssh #{user}@#{host} -p 22 -t 'cd #{fetch(:deploy_to)}/current && #{command}'"
    exec cmd
  end
end

Rails Model scope with belongs_to association

class Feed < ActiveRecord::Base
  has_many :posts, dependent: :destroy
end
class Post < ActiveRecord::Base
  belongs_to :feed

  scope :only_active_feed, lambda { |active|
    joins(:feed).where(feeds: {active: active})
  }
end
  Post.only_active_feed(true)