How to make Emacs use tabs instead of spaces?

Not all major modes handle indentation the same way, and so you may have to make some adjustments to certain modes to get the behaviour that you want. Often they will have their own indentation settings, e.g. cperl-indent-level.

In cc-mode based modes for C-like languages, something like this should do what you want:

(setq-default indent-tabs-mode t)
(setq-default tab-width 4) ; Assuming you want your tabs to be four spaces wide
(defvaralias 'c-basic-offset 'tab-width)

Note that there are some interesting situations that can come up when using tabs for indentation. The EmacsWiki indentation basics page is worth reading, if only to understand how Emacs treats indentation differently from other editors.

Edit:

For ruby-mode, this should work (assuming you've already set tab-width as above):

(setq ruby-indent-tabs-mode t)
(defvaralias 'ruby-indent-level 'tab-width)

For sgml-mode-derived modes, including html-mode:

(defvaralias 'sgml-basic-offset 'tab-width)