Fix ruby code