Skip to content

Instantly share code, notes, and snippets.

@thorwebdev
Forked from caseywatts/Gemfile
Last active May 15, 2016 16:45
Show Gist options
  • Save thorwebdev/f71ef966f488ab8fd984e0791cf96c07 to your computer and use it in GitHub Desktop.
Save thorwebdev/f71ef966f488ab8fd984e0791cf96c07 to your computer and use it in GitHub Desktop.
Sinatra + Stripe on Cloud9

Cloud 9 - Sinatra + Stripe

Setting Up Cloud9

  • Go to c9.io and log in
  • Create a new workspace
    • Workspace name = hello-stripe
    • Clone from Git or Mercurial URL = https://gist.github.com/f71ef966f488ab8fd984e0791cf96c07.git
    • (everything else at defaults)

In Cloud9

Check out the files you have in this folder, see what they have.

In the terminal (at the bottom where it says bash) type:

  • gem install sinatra sinatra-contrib stripe
    • this will install the ruby libraries, called gems, that we need to run our webservice with Stripe
  • ruby app.rb -o $IP -p $PORT
    • this will run the file app.rb, and tell it to make the site available online at a location.
    • Cloud 9 has wired things up so $IP and $PORT contains what it should on their server.
  • In the menu bar, click Preview => Preview Running Application and a browser pane will appear.
  • After each change you make to our files:
    • save the file(s)
    • refresh the browser pane
require 'sinatra'
require 'sinatra/reloader' if development?
get '/' do
"Hello World! Welcome to Ruby!"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment