Created
May 29, 2015 19:19
-
-
Save clausd/9626209e1329785bf276 to your computer and use it in GitHub Desktop.
Deploy sinatra apps quickly on Site 5
This file contains hidden or 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
| # you might not need this stupid hack but my .bashrc is not picked up... | |
| source ~/.bashrc | |
| APP_ROOT=`pwd` | |
| BASE_URI='/' | |
| RUBY='ruby20' | |
| USERNAME=`whoami` | |
| cat << EOF > htaccess | |
| PassengerRuby /usr/local/$RUBY/bin/ruby | |
| PassengerEnabled on | |
| RackBaseURI $BASE_URI | |
| PassengerAppRoot $APP_ROOT | |
| SetEnv GEM_PATH /home/$USERNAME/ruby/gems:/usr/local/$RUBY/lib64/ruby/gems/: | |
| EOF | |
| cat << EOF > config.ru | |
| require 'bundler/setup' | |
| require 'rubygems' | |
| require 'sinatra' | |
| require './app.rb' | |
| run Sinatra::Application | |
| EOF | |
| mkdir tmp | |
| echo "Inspect .htaccess (check RackBaseUri) - modify if deploying to a subdir" | |
| echo "Inspect config.ru (check app.rb file)" | |
| #TODO Check for ruby version line in Gemfile | |
| bundle install --path ruby | |
| echo Now touch tmp/restart.txt | |
This file contains hidden or 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
| Getting Ruby above 1.8.7 up and running on Site 5 | |
| Start with http://kb.site5.com/ruby-on-rails/select-a-version-of-ruby-for-your-hosting-account/ is a little off | |
| For some reason - my .bashrc is not picked up - but I can just | |
| source .bashrc | |
| and that works then | |
| Check your Ruby is 1.9 something or 2.0 something | |
| Now you need to install bundler AFTER doing that | |
| verify your bundle command is now in ~/ruby/gems | |
| Remember to add | |
| ruby "2.0.0" | |
| or similar to your Gemfiles and use the deploy script above... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment