Make a todo list web app in Ruby

Instructions for getting set up for the workshop on a Mac

Download starting point View on GitHub

Install a Text Editor for writing code

If you don't already have it installed, download Sublime Text. If you've used Atom or TextMate before those can be used too.

Get set up for the workshop

Follow the steps in the screencast video below or see the written notes underneath.

Install the Command Line Developer Tools

If you're running Yosemite (OS X 10.10) or Mavericks (OS X 10.9) then you'll already have a new enough version of Ruby to take part in the workshop. You just need to install the command line developer tools that are needed for some of the add-on code we'll be using. To do this:

  1. Open the Applications folder in Finder, open the Utilities folder inside there, and then open the Terminal app
  2. type the command gcc and press Enter
    1. If the developer tools are already installed you'll see a message `clang: error: no input files` and you're all set
    2. If not, you'll see a prompt 'The "gcc" command requires the command line developer tools. Would you like to install the tools now?'
      In this case, click Install, click Accept on the licence agreement that's displayed and finally click Done once the download is complete

Download the code for the workshop

  1. Download the starting point code for the workshop here
  2. Switch back to Finder and go to the Downloads folder
  3. If using Safari then the downloaded code will have been unzipped automatically. For any other browser double-click the ruby_todo-0.4.zip file
  4. You should now have a ruby_todo-0.4 folder
  5. Rename the ruby_todo-0.4 folder to the shorter name ruby_todo
  6. Switch back to the Terminal app
  7. Change to the folder with the downloaded code using the command cd Downloads/ruby_todo
  8. Run the command sudo gem install bundler - enter the password used to log in to your Mac, if asked
  9. Run the command bundle install which will install everything else that we're going to need

Test it!

  1. Still in the Terminal which should still be in the ruby_todo folder run the command rackup, this will start the web server for the app
  2. With the web server running go to the address localhost:9292 and you should see a web page saying Sinatra doesn't know this ditty, this tells us that the app is ready but that it dosen't have any pages yet

If you get this far then everything is ready to go!