Skip to content

Instantly share code, notes, and snippets.

@jonatasemidio
Created June 8, 2017 18:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonatasemidio/ca1ce4c6cef77fc051c3d5ddd28f9917 to your computer and use it in GitHub Desktop.
Save jonatasemidio/ca1ce4c6cef77fc051c3d5ddd28f9917 to your computer and use it in GitHub Desktop.
Setting up a blank Cloud 9 workspace for Ruby and Sinatra Raw

Basic Sinatra Workshop Setup

Cloud 9 workspace for Ruby and Sinatra

  • Sign up for Cloud9

  • Create a BLANK workspace (Not Ruby and Not Rails)

  • Name the workspace hello-sinatra

  • Open the workspace

  • In the terminal tab at the bottom

$ gem install bundler

$ bundle init
  • edit Gemfile to add sinatra
source "https://rubygems.org"

gem 'sinatra'
  • Run bundle install

  • Create the app.rb file

require 'sinatra'

get '/' do
  "HELLO WORLD"
end
  • Run the app
    $ ruby app.rb -p $PORT -o $IP 
  • Open the browser to the link in your terminal which will be something like
https://hello-sinatra-stujo.c9users.io/
  • The link is made with this format:
    https://[YOUR APP NAME]-[YOUR USER NAME].c9users.io/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment