Skip to content

Instantly share code, notes, and snippets.

@kapkaev
Created January 6, 2012 12:16
Show Gist options
  • Save kapkaev/1570321 to your computer and use it in GitHub Desktop.
Save kapkaev/1570321 to your computer and use it in GitHub Desktop.
sinatra && rvm && unicorn && nginx
#!/usr/bin/env ruby
require 'rubygems'
require 'sinatra'
require 'haml'
class App < Sinatra::Application
get '/' do
haml :index
end
end
require './app'
use Rack::ShowExceptions
run App.new
#unicorn or unicorn -p 3000
#vim Gemfile
source 'http://rubygems.org'
gem 'sinatra'
gem 'shotgun'
gem 'haml'
gem 'sass'
gem 'unicorn'
#:wq
bundler install
# nginx setup
sudo -s
nginx=stable # use nginx=development for latest development version
add-apt-repository ppa:nginx/$nginx
apt-get update
apt-get install nginx
# nginx start
sudo service nginx start
mkdir sinatra_app
echo rvm --create use 1.9.3@sinatra_app >> .rvmrc
echo rvm_trust_rvmrcs_flag = 1 >> .rvmrc
cd sinatra_app
mkdir config
mkdir public
mkdir public/images
mkdir public/javascripts
mkdir public/stylesheets
mkdir views
vim app.rb
%h1
Care Engine
%p
This is the app! Hello world!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment