Using spork4 and rspec 3, when run spork
in terminal, it fails and show this following message:
Using RSpec, Rails
Preloading Rails environment
Loading Spork.prefork block...
# This is a skeleton for testing models including examples of validations, callbacks, | |
# scopes, instance & class methods, associations, and more. | |
# Pick and choose what you want, as all models don't NEED to be tested at this depth. | |
# | |
# I'm always eager to hear new tips & suggestions as I'm still new to testing, | |
# so if you have any, please share! | |
# | |
# @kyletcarlson | |
# | |
# This skeleton also assumes you're using the following gems: |
require 'rails_helper' | |
RSpec.describe TodosController, :type => :controller do | |
context "GET index" do | |
#context "POST create" do | |
#context "GET show" do | |
#context "PATCH update" do (or PUT update) | |
#context "DELETE destroy" do | |
#context "GET new" do |
1. Open terminal and check versions of Ruby and Rails against production server params or to make sure you are using the most recent stable versions. | |
$ ruby -v | |
$ rvm list | |
$ rvm list known | |
$ rvm install ruby 2.3.1 | |
$ rvm list | |
$ ruby -v | |
$ gem install rails | |
$ rails -v |
--------------------------------------------------------------------------------------------------------- | |
# app/helpers/application_helper.rb | |
--------------------------------------------------------------------------------------------------------- | |
def horizontal_simple_form_for(record, options={}, &block) | |
options[:html] ||= {} | |
options[:html][:class] = "form-horizontal #{options[:html][:class]}".rstrip | |
options[:wrapper] = :bootstrap_horizontal | |
simple_form_for(record, options, &block) | |
end | |
--------------------------------------------------------------------------------------------------------- |
#!/usr/bin/ruby | |
--database=postgresql | |
--skip-bundle | |
--skip-keeps | |
--skip-test | |
template=/path-to-template.rb |
module RailsTemplate | |
module Gem | |
extend self | |
def use(name, options={}) | |
require_path = options[:require] || name | |
begin | |
require require_path | |
rescue LoadError | |
system "gem install #{name}" |
To get some nice colors in your irb, you can install the gems awesome_print
and interactive_editor
. There should be a dot file (hidden file) in your home directory called .irbrc, if not just create it: sublime ~/.irbrc
.
gem install awesome_print
gem install interactive_editor
sublime ~/.irbrc
# As admin you can create other Admin Users with thier email only where password link is sent via email | |
# 1- Gemfile | |
gem 'devise' | |
gem 'activeadmin', github: 'gregbell/active_admin' | |
# 2- Install Devise then Active Admin | |
rails g devise:install | |
rails g active_admin:install | |
# You might see other instructions inthe terminal, just follow them |
This guide enables you to install (ruby-build) and use (rbenv) multiple versions of ruby, isolate project gems (gemsets and/or bundler), and automatically use appropriate combinations of rubies and gems.
# Ensure system is in ship-shape.
aptitude install git zsh libssl-dev zlib1g-dev libreadline-dev libyaml-dev