Rule-based ethical theories like Kant's appear to be promising for machine ethics because of the computational structure of their judgments. On one formalist interpretation of Kant's categorical imperative, for instance, a machine could place prospective actions into the traditional deontic categories (forbidden, permissible, obligatory) by a simple consistency test on the maxim of action. We might enhance this test by adding a declarative set of subsidiary maxims and other "buttressing" rules. The ethical judgment is then an outcome of the consistency test. While this kind of test can generate results, it may be vacuous in the sense that it would do no more than forbid obviously contradictory maxims of action. It is also possible that the kind of inference in such a rule-based system may be nonmonotonic. I discuss these challenges to a rule-based machine ethics, starting from the framework of Kantian ethics.