Jump Start Sinatra Released!

Tweet

I’m really pleased to announce that my book Jump Start Sinatra has just been published in electronic format.

The book is small, which is fitting because Sinatra is too (but perfectly formed!). The idea is the same as with all the books in the Jump Start series – you can read it over a weekend and quickly get up to speed with Sinatra.

Jump Start Sinatra dives straight into using Sinatra in Chapter One, covering installation and some basic examples. After this, I explain how to build a modular, database-driven website from start to finish in a tutorial format. Sinatra allows you to develop applications rapidly with minimal fuss using an expressive syntax that’s simple to follow. It’s fast and stable, without tying your hands with enforced conventions.There are no barriers to entry; all you need is a text editor. Some experience of Ruby would help, but as long as you’re familiar with a bit of programming and HTML, you should be fine.

In the book, I cover using ERB and Slim to create views, using CSS preprocessors such as Sass, connecting to a database using DataMapper, using Sinatra’s configuration options and helper methods, using CoffeeScript to take the pain out of JavaScript, as well as deploying applications to the Heroku service. It also covers developing your own Sinatra extensions and middleware, as well as making modular applications that can be used as Rack middleware.

By the time you finish reading, you should have everything you need to know to go on and build a fully functioning web application. Sinatra gives you the tools to put your Ruby code onto the Web, then jumps out of the way to let you get on with developing your application your way. Whether you want to build a small and simple website, massive database-driven application, or the next big social media sensation, this book will give you the tools you need to get started.

You can download a sample chapter and buy the book from here. Go on … make your Ruby projects sing!

Free book: Jump Start HTML5 Basics

Grab a free copy of one our latest ebooks! Packed with hints and tips on HTML5's most powerful new features.

  • Cane

    I bought the book, but got stuck on the first exercise…
    On the Mac, it will only display this message in the terminal:
    “hello.rb:1:in `require': no such file to load — sinatra (LoadError)”
    and on Windows, the first part worked, but when adding the second route, it still shows “Hello Sinatra!” instead of “Hello Frank.”

    Hope someone can help out.

    • Cane

      Apparently running “$ brew install ruby”, won’t automatically get me a newer version of Ruby. I’m still stuck with 1.8.7. That’s why it wouldn’t work on the Mac.

  • http://daz4126.com/ Darren Jones

    Hi Cane,

    Sorry to hear that you’ve had some trouble with installing the latest Ruby. I don’t use a Mac, but I’d definitely recommend using RVM to manage your Ruby installation – it’s very easy to use and allows you to use multiple versions (so you can also try out the latest version 2.0!)

    I’m not sure why the “Hello Frank.” route doesn’t work (it should!), feel free to send me your code and I’ll have a look at it for you (daz4126 at gmail)

    Hope that helps,

    DAZ

  • http://www.chasepursley.com Chase Pursley (@gcpursley)

    About halfway through the book in a day. Enjoying it so far!

  • Vivekanand

    Hi – I am in Chapter 3 and currently stuck on Showing Songs section. I am getting the below error when I try to visit http://localhost:4567/songs/1

    NoMethodError at /songs/1
    undefined method `title’ for nil:NilClass
    file: show_song.slim
    location: block in singleton class
    line: 1

    I get the same error when I downloaded the code.
    Any Inputs on the above is appreciated.

    Thanks!!!!

    • http://daz4126.com/ Darren Jones

      Hi Vivekanand,

      It looks like there isn’t a song with an id of 1 in your database. If you go into irb and do the following:

      > require ./main
      > Song.first

      Check the id of the first song in your database. If no songs exist at all then you need to go and creat some. If the id is different to 1, then just use this number in the URL instead of 1.

      Hope this makes sense. If you need any more help then send me a gmail (daz4126)

      DAZ

  • Braden

    I’m having the same issue. The id of the record exists in the db. I get the very same error as above for #show but not for #edit or #destroy. The page even shows all the correct attributes for the record, yet the error is still thrown in the console.