A Ruby on Rails Application without models

This blog is a quick walkthrough of creating a Ruby On Rails application without a model.

Find Rails new options from here:
https://gist.github.com/abhilashak/3c0c62fa62b2f7a439c417b68d032575

Find Gemfile options from here:

http://bundler.io/v1.2/gemfile.html

Install Ruby/Rails using rbenv

$ touch .rbenv-gemsets
$ echo project-name > .rbenv-gemsets
$ rbenv gemset active
$ rbenv install 2.5.3
$ gem install bundler
$ rbenv rehash
$ gem install rails -v 5.2.9
$ rbenv rehash
$ rails new my-new-porject --skip-active-record --skip-bundle -v 5.2.9

Add in Gemfile:

ruby “2.5.3”

comment jbuilder, we don’t need it.

# gem 'jbuilder', '~> 2.8’

Move rbenv gems file to new rails app folder

$ mv .rbenv-gemsets my-new-porject

$ touch .ruby-version

$ echo 2.5.3 > .ruby-version

$ gem install bundler

$ bundle

$ ruby -v
ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin18]

Start Rails server:

$ rails s

Gemfile add:

# Bootstrap Theme

gem 'bootstrap', '~> 4.3.0’

# Slim template Engine

gem 'slim', '>=4.0.1’

Do Bundle Install

$ bundle

Rename css to scss because we use bootsrap mixins and variables that work with scss files

$ mv app/assets/stylesheets/application.css app/assets/stylesheets/application.scss

Import Bootstrap styles in app/assets/stylesheets/application.scss:

// Custom bootstrap variables must be set or imported *before* bootstrap.
@import "bootstrap";

Then, remove all the *= require and *= require_tree statements from the Sass file. Instead, use @import to import Sass files.

Bootstrap JavaScript depends on jQuery
Add jquery-rails to Gemfile:

gem 'jquery-rails', '~> 4.3.4’

Bootstrap tooltips and popovers depend on popper.js for positioning.
Add Bootstrap dependencies and Bootstrap to your application.js:

//= require jquery3
//= require popper
//= require bootstrap-sprockets

While bootstrap-sprockets provides individual Bootstrap components for ease of debugging, you may alternatively require the concatenated bootstrap for faster compilation:

//= require jquery3
//= require popper
//= require bootstrap

Sass: Individual components

All Bootstrap opponents will be imported by default.
You can also import components explicitly. To start with a full list of modules copy _bootstrap.scss file into your assets as _bootstrap-custom.scss. Then comment out components you do not want from _bootstrap-custom. In the application Sass file, replace @import ‘bootstrap’ with:

@import 'bootstrap-custom';

Your application.css:

/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *
 */

/*Custom bootstrap variables must be set or imported *before* bootstrap.
  The available variables can be found: 
  https://github.com/twbs/bootstrap-rubygem/blob/master/assets/stylesheets/bootstrap/_variables.scss
*/
@import "bootstrap";

Your application.js File:

// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, or any plugin's
// vendor/assets/javascripts directory can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// compiled file. JavaScript code in this file should be added after the last require_* statement.
//
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
// about supported directives.
//
//= require rails-ujs
//= require turbolinks
//= require_tree .
//= require jquery3
//= require popper
//= require bootstrap-sprockets

You can check sample bootstrap forms here:

https://bootsnipp.com/snippets/featured/login-amp-signup-forms-in-panel

Remove cable.js from javascripts # we don’t need this for now

Install Skype in Ubuntu 13.04

For 32 bit:

Install Dependencies.

$ sudo apt-get install libqt4-webkit

Download and install Skype

$ wget -O skype-linux.deb http://download.skype.com/linux/skype-ubuntu-lucid_4.2.0.11-1_i386.deb
$ sudo dpkg -i skype-linux.deb
$ sudo apt-get -f install

Open the terminal and type

$ skype

Done.

Reference:
noobslab install skype

Install Rails 3.1.3 and set up in Linux

Install RVM

If you are not already installed RVM install from here:
https://rvm.beginrescueend.com/rvm/install/

If you already have rvm installed, update it to the latest version.

$ rvm get latest
$ rvm reload
$ rvm -v

Create a Rails 3.1.3 Gemset

Create a default Rails 3.1.3 gemset. It’s advisable to create a new gemset for each application you build. But to get started, create just one new Rails 3.1.3 gemset as your default.

$ rvm ruby-1.9.2-p290@rails313 --create --default

To see a list of the gemsets you have installed:

$ rvm gemset list

And see a list of the gems included with the standard Ruby installation:

$ gem list

$ rvm list gemsets

rvm gemsets

ruby-1.9.2-p290 [ i386 ]
ruby-1.9.2-p290@global [ i386 ]
=> ruby-1.9.2-p290@rails313 [ i386 ]

Make sure you are using the newest version of Rake before you install Rails 3.1.3.

$ gem update rake
$ rake --version

Install Rails

$ gem install rails -v "3.1.3"

DETAILS:

RVM Version

rvm 1.10.1 by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.beginrescueend.com/]

Bundler Version

builder (3.0.0)
bundler (1.0.21)

LOCAL GEMS after installed Rails 3.1.3

*** LOCAL GEMS ***

actionmailer (3.1.3)
actionpack (3.1.3)
activemodel (3.1.3)
activerecord (3.1.3)
activeresource (3.1.3)
activesupport (3.1.3)
arel (2.2.1)
builder (3.0.0)
bundler (1.0.21)
erubis (2.7.0)
hike (1.2.1)
i18n (0.6.0)
json (1.6.5)
mail (2.3.0)
mime-types (1.17.2)
multi_json (1.0.4)
polyglot (0.3.3)
rack (1.3.6)
rack-cache (1.1)
rack-mount (0.8.3)
rack-ssl (1.3.2)
rack-test (0.6.1)
rails (3.1.3)
railties (3.1.3)
rake (0.9.2.2)
rdoc (3.12)
sprockets (2.0.3)
thor (0.14.6)
tilt (1.3.3)
treetop (1.4.10)
tzinfo (0.3.31)

Unicorn Version

unicorn (4.1.1)
All Gems installed
actionmailer (3.1.3)
actionpack (3.1.3)
activemodel (3.1.3)
activerecord (3.1.3)
activeresource (3.1.3)
activesupport (3.1.3)
addressable (2.2.4)
ansi (1.4.1)
arel (2.2.1)
aws-s3 (0.6.2)
bcrypt-ruby (2.1.4)
builder (3.0.0)
bundler (1.0.21)
cocaine (0.2.1)
coffee-script (2.2.0)
coffee-script-source (1.2.0)
colorize (0.5.8)
daemons (1.1.5)
delayed_job (2.1.4)
devise (1.4.2)
diff-lcs (1.1.3)
erubis (2.7.0)
execjs (1.2.6)
faraday (0.6.1)
hashie (1.2.0)
hike (1.2.1)
hoe (2.12.5)
i18n (0.6.0)
jquery-rails (1.0.14)
json (1.6.5)
kaminari (0.12.4)
kgio (2.7.2)
libv8 (3.3.10.4 x86-linux)
machinist (2.0.0.beta2)
mail (2.3.0)
metaclass (0.0.1)
mime-types (1.17.2)
mocha (0.10.0)
multi_json (1.0.4)
multi_xml (0.2.2)
multipart-post (1.1.4)
mysql2 (0.3.6)
net-ldap (0.2.2)
newrelic_rpm (3.3.0)
nifty-generators (0.4.6)
nokogiri (1.4.7)
oa-basic (0.2.6)
oa-core (0.2.6)
oa-enterprise (0.2.6)
oa-more (0.2.6)
oa-oauth (0.2.6)
oa-openid (0.2.6)
oauth (0.4.5)
oauth2 (0.4.1)
omniauth (0.2.6)
orm_adapter (0.0.6)
polyglot (0.3.3)
pyu-ruby-sasl (0.0.3.3)
rack (1.3.6)
rack-cache (1.1)
rack-mount (0.8.3)
rack-openid (1.3.1)
rack-ssl (1.3.2)
rack-test (0.6.1)
rails (3.1.3)
railties (3.1.3)
raindrops (0.8.0)
rake (0.9.2.2)
rdoc (3.12)
rest-client (1.6.7)
riddle (1.5.1)
rspec (2.6.0)
rspec-core (2.6.4)
rspec-expectations (2.6.0)
rspec-mocks (2.6.0)
rspec-rails (2.6.1)
ruby-openid (2.1.8)
ruby-openid-apps-discovery (1.2.0)
rubyntlm (0.1.1)
sass (3.1.12)
sass-rails (3.1.2)
sprockets (2.0.3)
SyslogLogger (1.4.0)
therubyracer (0.9.4)
thinking-sphinx (2.0.10)
thor (0.14.6)
tilt (1.3.3)
treetop (1.4.10)
ts-delayed-delta (1.1.2)
turn (0.8.2)
tzinfo (0.3.31)
uglifier (1.0.3)
unicorn (4.1.1)
warden (1.0.6)
wkhtmltopdf (0.1.2)
xml-simple (1.1.1)