Skip to content

Instantly share code, notes, and snippets.

@mathildathompson
Last active August 29, 2015 13:57
Show Gist options
  • Select an option

  • Save mathildathompson/9540484 to your computer and use it in GitHub Desktop.

Select an option

Save mathildathompson/9540484 to your computer and use it in GitHub Desktop.
##Dependencies
#If you want to require library c when you install it it requires library d;
#Things you are depending on depend on other things;
##PACKAGE MANAGER SOLVES ALL OF THIS!
gem install package name #Will work out where to store it on your system, it will work out all the dependencies and go and download them;
#Some gems are very complicated such as ImageMagick, it depends on software that is written on your computer and not in ruby;
require 'sinatra' #only works if we have installed sinatra on our machine;
#Bundle a tool that installs lots of gems for you;
#Bundle install also creates a Gemfile.lock - it will say the current version of each gem that you are using;
#Gemfile.lock #It locks the versions says which version of the gem work with the app;
#Bundle install, looks at dependencies and can work backwards to find out the most recent version of the dependency that works with all of them gems;
#Heroku needs a Gemfile, heroku cant have every gem installed - we need to tell it what Gems our application relies on;
http://www.bundler.io
config.ru #Describes to the server how to run our website
./ go into the current directory ad get main.rb
ru stands for rackup a way of loading servers -
heroku only works using rackup -
#bundle install in ther terminal #creates a Gemfile.lock;
bundle show sinatra #to show where it is installed on your machine
rackup #to run the application
require 'rubygems'
require 'bundler'
Bundler.require #anything that we metion in our gemfile will be required, we do not need to write require at the top of the file;
#Rack is a tool that you plug a server into;
#Webrick is a server that comes with Ruby;
##CSS
-webkit-filter: saturate(0%)
-webkit-filter: saturate(100%)
##MVC
#The contoller can talk to the model and the model has all the information about the database;
#The controller can also talk to the view;
#The controller is like the main.rb in Sinatra opplication;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment