In this series I’ve built out a Rails app from scratch, deployed it and I’m this close to getting it actually useful.
Will today be that final bit to hit “useful?” I don’t know as I write this, but it’s getting closer…
Last week we built out subscription buttons, profiles for managing subscriptions...
In this series I’ve built out a Rails app from scratch, deployed it and I’m not too far off from getting it actually useful.
I’ve also had a nice photo shoot with my stuffed animals so the site’s a lot prettier.
I want to build email reminders. It’s the last major thing for the site. Unfortunately...
You can learn a lot about how much a man fears something by seeing what he will do to procrastinate instead of doing it. Paul Graham talks about “sneaking” out to get a root canal, feeling like he was getting away with it, to avoid a board meeting of his first startup.
I talked last time about how...
In this series I’m building courseware (teaching software) to let folks go through lessons in a better way than the simple email classes I use now. Last week we figured out how to track progress for a user in a topic using an AJAX call hooked up to a button and selector in the browser. It looks okay...
In this series I’m building courseware (teaching software) to let folks go through lessons in a better way than the simple email classes I use now.
It’s getting close to the point where random users could benefit from it. What’s it’s missing now are email reminders, being deployed (available to use...
I’ve been building a piece of Rails courseware, something to let people work through blog posts, videos and lessons I’ve written at their own speed. First I set up a simple Rails 6 app, then I prettied it up a bit.
Now it’s time to do something interesting with the actual lessons, which I’ve been...
Last time we talked about why I’m building course software in Rails from scratch, and built out a basic skeleton of database tables and a first trivial view.
Today, let’s add a theme, build out the view a little more and generally make it look better. I think “Let’s Build” series look better with...
(Don’t care about explanations? Scroll down for screenshots and code.)
Over the years, I’ve accumulated a bunch of blog posts, YouTube videos, conference talks and so on, teaching the things I teach — Ruby and Rails programming, building web frameworks, raw coding technique and more.
I want to put...
Lots of you loved my old post on this. Thanks! But thanks to many fine questions, especially by one guy on Twitter, it’s time for an update! And also, naturally, the same things you loved last time. I’m not heartless.
Sometimes you’re sure that’s not the right place for that piece of code, but where...
Are you deploying a Rails app? Here are lots of things you’ll probably have to watch for as you do… I’ve been writing an open-source gem and a (edited to add: now defunct) for-pay online class about this for months now. Let me share some things.
There are lots of big reasons that deploying a Rails app is hard. And lots of well-known, big tasks. But when you’re provisioning a server and deploying your application to it, lots of little things go wrong too.
I feel like the big things get a lot of respect already. Let’s look into some of the under-appreciated little things you have to get right in order to make a good deploy happen.
For starters, a lot of these small issues can require a lot of debugging. You know those two-line fixes that take three hours to find? Deployment is full of those. Here are some of mine to speed you on your way.
You can’t compile recent Ruby on a VM with less than approximately 1GB of RAM. The amount varies a bit, of course.
When you try, you discover that GCC gives an internal compiler error as its “out of RAM” notice. Also, that the RVM cookbook tells you a completely wrong directory for the six logfiles to check for errors. At least, if you install RVM in user directories.
If you’re new to Ruby on Rails, you may be new to the old debates (pro and con) about how “Rails doesn’t scale.” You might wonder why people say that, or where it came from.
Let’s talk about that.
As far as “Rails Doesn’t Scale”, the main arguments go something like:
This isn’t actually a scaling argument. But it’s true that Ruby is slow. Not 50x any more, closer to 5x (up to maybe 20x), but still, that’s not terribly speedy.
Rails doesn’t help Ruby here. A lot of the metaprogramming techniques it uses are among the slowest things Ruby does. I wrote a book about how Rails uses those techniques called Rebuilding Rails. They’re awesome, but they’re not speedy.
In practice, Ruby and Rails apps often “farm out” the slow stuff. The database is the traditional place to put the heavy lifting, but you’ll see Redis and Cassandra used in similar ways. Want Ruby to be fast? Call to something that isn’t Ruby, and is designed for speed :-)
Pure Ruby is quite slow, but just as scalable as any other language or library. It doesn’t get somehow slower as you add more.
There was once more truth to this. Ruby had a few leaks and Rails exercised Ruby like nothing else. Also, ActiveRecord encourages large amounts of garbage per request, which was easy to mistake for leaks.