You need to either set the default value of the variable, if you want it for every file:
(setq-default require-final-newline t)
;; or ...
(customize-set-variable 'require-final-newline t)
or to set it in the mode hook, if you only want it for files of that mode:
(add-hook 'some-mode-hook (lambda () (setq-local require-final-newline t)))
The reason that a ...