Sunday 1 November 2015

Install Ruby on Rails in CentOS7



1) Install prerequisites.

[shabbir@compute1~]$ sudo yum install -y git-core zlib zlib-devel gcc-c++ patch readline readline-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison curl sqlite-devel


2) Install rbenv

[shabbir@compute1~]$ git clone git://github.com/sstephenson/rbenv.git .rbenv

[shabbir@compute1~]$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile

[shabbir@compute1~]$ echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
  
[shabbir@compute1~]$ exec $SHELL
  
[shabbir@compute1~]$ git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
  
[shabbir@compute1~]$ echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bash_profile
  
[shabbir@compute1~]$ exec $SHELL

Reboot the machine.
[shabbir@compute1~]$ systemctl reboot



3) Install Ruby

[shabbir@compute1 ~]$ rbenv install -v 2.2.3

[shabbir@compute1 ~]$ rbenv global 2.2.3


Verify that Ruby was installed properly.
[shabbir@compute1 ~]$ ruby -v
ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]


[shabbir@compute1 ~]$ echo "gem: --no-document" > ~/.gemrc

[shabbir@compute1 ~]$ gem install bundler



4) Install Rails 

[shabbir@compute1 ~]$ gem install rails -v 4.2.4

[shabbir@compute1 ~]$ rbenv rehash 

Verify that Rails was installed properly.
[shabbir@compute1 ~]$ rails -v
Rails 4.2.4

 
 
5) Install JavaScript Runtime

Install EPEL Repository.
[shabbir@compute1 ~]$ sudo yum -y install epel-release


[shabbir@compute1 ~]$ sudo yum install nodejs



6) Install Database

[shabbir@compute1 ~]$ sudo yum groupinstall mariadb


[shabbir@compute1 ~]$ sudo yum install mariadb-devel

[shabbir@compute1 ~]$ sudo systemctl enable mariadb

[shabbir@compute1 ~]$ sudo systemctl start mariadb 

[shabbir@compute1 ~]$ gem install mysql

[shabbir@compute1 ~]$ rbenv rehash



7) Create 'Hello World' Application

7.1) Create Demo Project
[shabbir@compute1 ~]$ rails new demo


7.2) Start the Web Server.
[shabbir@compute1 ~]$ cd demo 

[shabbir@compute1 demo]$ rails server

7.3) Open a browser and type the following URL. http://localhost:3000
 





NOTE: To stop the web server, hit Ctrl+C in the terminal window where it's running.


7.4) Create a new controller called "welcome" with an action called "index".

[shabbir@compute1 demo]$ generate controller welcome index
      create  app/controllers/welcome_controller.rb
       route  get 'welcome/index'
      invoke  erb
      create    app/views/welcome
      create    app/views/welcome/index.html.erb
      invoke  test_unit
      create    test/controllers/welcome_controller_test.rb
      invoke  helper
      create    app/helpers/welcome_helper.rb
      invoke    test_unit
      invoke  assets
      invoke    coffee
      create      app/assets/javascripts/welcome.coffee
      invoke    scss
      create      app/assets/stylesheets/welcome.scss



The controller, is located at app/controllers/welcome_controller.rb and the view, located at app/views/welcome/index.html.erb.


7.5) Edit the View.

[shabbir@compute1 demo]$ vi app/views/welcome/index.html.erb

<h1>Hello, World!</h1>



7.6) Now that we have made the controller and view, we need to tell Rails when we want "Hello, World!" to show up. In our case, we want it to show up when we navigate to the root URL of our site, http://localhost:3000. At the moment, "Welcome aboard" is occupying that spot.

Edit the application's routing file.
[shabbir@compute1 demo]$ vi config/routes.rb

Uncomment the following line
  root 'welcome#index'


7.7) Ensure that the Web server is running. Open a browser and type the following URL. http://localhost:3000

 


2 comments:

  1. Hey Guys !

    USA Fresh & Verified SSN Leads along with Driving License/ ID Number, AVAILABLE with 99.9% connectivity
    All Leads have genuine & valid information.

    **DETAILS IN LEADS**
    First Name | Last Name | SSN | Dob | Driving License Number | Address | City | State | Zip | Phone Number | Account Number | Payday | Bank Name | Employee Details | IP Address

    *Price for SSN lead $2
    *You can ask for sample before any deal
    *If anyone buy in bulk, we can negotiate
    *Sampling is just for serious buyers

    ==>ACTIVE, FRESH CC & CVV FULLZ AVAILABLE<==
    ->$5 PER EACH

    ->Hope for the long term Business
    ->Interested buyers will be welcome

    **Contact 24/7**
    Whatsapp > +923172721122
    Email > leads.sellers1212@gmail.com
    Telegram > @leadsupplier
    ICQ > 752822040

    ReplyDelete
  2. Hi Guy's

    Fresh & valid spammed USA SSN+Dob Leads with DL available in bulk.

    >>1$ each SSN+DOB
    >>3$ each with SSN+DOB+DL
    >>5$ each for premium fullz (700+ credit score with replacement guarantee)

    Prices are negotiable in bulk order
    Serious buyer contact me no time wasters please
    Bulk order will be preferable

    CONTACT
    Telegram > @leadsupplier
    ICQ > 752822040
    Email > leads.sellers1212@gmail.com

    OTHER STUFF YOU CAN GET

    SSN+DOB Fullz
    CC's with CVV's (vbv & non-vbv)
    USA Photo ID'S (Front & back)

    All type of tutorials available
    (Carding, spamming, hacking, scam page, Cash outs, dumps cash outs)

    SMTP Linux Root
    DUMPS with pins track 1 and 2
    WU & Bank transfers
    Socks, rdp's, vpn
    Php mailer
    Sql injector
    Bitcoin cracker
    Server I.P's
    HQ Emails with passwords
    All types of tools & tutorials.. & much more

    Looking for long term business
    For trust full vendor, feel free to contact

    CONTACT
    Telegram > @leadsupplier
    ICQ > 752822040
    Email > leads.sellers1212@gmail.com

    ReplyDelete