Created
January 6, 2012 12:16
-
-
Save kapkaev/1570321 to your computer and use it in GitHub Desktop.
sinatra && rvm && unicorn && nginx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'sinatra' | |
require 'haml' | |
class App < Sinatra::Application | |
get '/' do | |
haml :index | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require './app' | |
use Rack::ShowExceptions | |
run App.new | |
#unicorn or unicorn -p 3000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#vim Gemfile | |
source 'http://rubygems.org' | |
gem 'sinatra' | |
gem 'shotgun' | |
gem 'haml' | |
gem 'sass' | |
gem 'unicorn' | |
#:wq | |
bundler install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir sinatra_app | |
echo rvm --create use 1.9.3@sinatra_app >> .rvmrc | |
echo rvm_trust_rvmrcs_flag = 1 >> .rvmrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd sinatra_app | |
mkdir config | |
mkdir public | |
mkdir public/images | |
mkdir public/javascripts | |
mkdir public/stylesheets | |
mkdir views | |
vim app.rb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%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