Project

General

Profile

Support #707

Setup Ruby on Rails Development Environment on Arch

Added by Daniel Curtis over 8 years ago. Updated almost 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Web Server
Target version:
Start date:
12/06/2015
Due date:
% Done:

100%

Estimated time:
1.00 h
Spent time:

Description

This is a guide on how I setup my Ruby on Rails development environment to create a new RoR web application on Arch Linux.

Prepare the Environment

  • Make sure the system is up to date:
    sudo pacman -Syu
    
  • Install a few dependencies:
    sudo pacman -S ruby nodejs npm python2
    
  • Add bob to the sudo group:
    sudo usermod -aG sudo bob
    
  • Enable systemd-timesyncd:
    sudo systemctl enable systemd-timesyncd
    sudo systemctl start systemd-timesyncd
    

Install Multi-user RVM

  • Imports the RVM signing key:
    sudo gpg2 --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
    
    • NOTE: If that fails run the following:
      curl -sSL https://rvm.io/mpapis.asc | sudo gpg2 --import -
      
  • Download and install rvm as the bob user:
    curl -L get.rvm.io | sudo bash -s stable
    
  • After the script has finishes edit the ~/.bashrc file:
    nano ~/.bashrc
    
    • Then add the following line to the end of the file
      [[ -s "/usr/local/rvm/scripts/rvm" ]] && source "/usr/local/rvm/scripts/rvm" 
      
  • Add bob to the rvm group:
    sudo usermod -aG rvm bob
    
    • Logout and then login again for the group changes to take effect.
  • Check any missing requirements for RVM:
    rvm requirements
    

Install Ruby

  • List the known available ruby versions:
    rvm list known
    
  • Install Ruby 2.2:
    rvm install 2.2
    
  • Install the rails gem:
    gem install rails
    
    • (Optional) Install libv8:
      gem install libv8 -- --with-system-v8
      

Create a New Web Application

  • Create the new Ruby on Rails web application:
    rails new new_app
    
  • Install the new web applications dependencies:
    bundle install --path vendor/bundle
    
  • Start the rails development web server:
    bundle exec rails s
    
    • NOTE: The development web server bind the IP address to the localhost by default, so accessing it over the network will not work. To allow network access to the development web server:
      bundle exec rails s -b 0.0.0.0
      

Resources

#1

Updated by Daniel Curtis over 8 years ago

  • Description updated (diff)
  • Status changed from New to In Progress
  • % Done changed from 0 to 50
#2

Updated by Daniel Curtis over 8 years ago

  • Description updated (diff)
#3

Updated by Daniel Curtis over 8 years ago

  • Description updated (diff)
  • % Done changed from 50 to 60
#4

Updated by Daniel Curtis over 8 years ago

  • Description updated (diff)
  • % Done changed from 60 to 70
#5

Updated by Daniel Curtis over 8 years ago

  • Description updated (diff)
  • % Done changed from 70 to 100
#6

Updated by Daniel Curtis over 8 years ago

  • Description updated (diff)
  • Status changed from In Progress to Resolved
#7

Updated by Daniel Curtis about 8 years ago

  • Status changed from Resolved to Closed
#8

Updated by Daniel Curtis almost 8 years ago

  • Description updated (diff)
#9

Updated by Daniel Curtis almost 8 years ago

  • Description updated (diff)
#10

Updated by Daniel Curtis almost 8 years ago

  • Description updated (diff)
#11

Updated by Daniel Curtis almost 8 years ago

  • Description updated (diff)
#12

Updated by Daniel Curtis almost 8 years ago

  • Description updated (diff)
#13

Updated by Daniel Curtis almost 8 years ago

  • Description updated (diff)
#14

Updated by Daniel Curtis almost 8 years ago

  • Description updated (diff)
#15

Updated by Daniel Curtis almost 8 years ago

  • Description updated (diff)
#16

Updated by Daniel Curtis almost 8 years ago

  • Description updated (diff)
#17

Updated by Daniel Curtis almost 8 years ago

  • Description updated (diff)
#18

Updated by Daniel Curtis almost 8 years ago

  • Description updated (diff)

Also available in: Atom PDF