- Overview
- Installing Prerequisites
- Installing Ruby with ruby-build
- Working with Gems
- Installing Rails
- Updating rbenv
- Uninstalling rbenv
They say don’t mix money and friends. In my case, I have chosen not to mix money and family any more.
I recently found myself in the situation of having to say no when my parents asked me for a €10,000 loan to fund construction work on a beautiful property in Europe that they’ve been turning into a family-run B&B and wedding venue.
This was not the first time they had found themselves in a tight spot. Four years previously, when I was 23, I’d loaned them €10,000 and had a strenuous time getting paid back.
Hit by the 2008 financial crisis, declining revenues from my father’s business and a credit crunch, my parents have been relying more and more on their kids for financial help. But when they asked me recently if I could loan them the lump sum, I declined.
remote: ! Failed to install gems via Bundler.
remote: ! Detected sqlite3 gem which is not supported on Heroku:
remote: ! https://devcenter.heroku.com/articles/sqlite3
remote: !
require 'jwt' | |
payload = { data: 'test' } | |
hmac_secret = 'my$ecretK3y' | |
token = JWT.encode(payload, hmac_secret, 'HS256') | |
#eyJhbGciOiJIUzI1NiJ9.eyJkYXRhIjoidGVzdCJ9.pNIWIL34Jo13LViZAJACzK6Yf0qnvT_BuwOxiMCPE-Y | |
puts token |
#config/routes.rb | |
namespace :api do | |
namespace :v1 do | |
post 'signin', to: 'authentication#create' | |
end | |
end |
# app/controllers/authentication_controller.rb | |
class AuthenticationController < ApplicationController | |
skip_before_action :authenticate_request | |
def create | |
command = AuthenticateUser.call(params[:email], params[:password]) | |
if command.success? | |
render json: { auth_token: command.result } |