I am trying to add ruby-mode to my emacs so i created .emacs file and copy the following code into it:
; directory where ruby-emacs.el is located
(add-to-list 'load-path "/Users/.rvm/src/ruby-2.2.0/misc/")
; loads ruby mode when a .rb file is opened.
(autoload 'ruby-mode "ruby-mode" "Major mode for editing ruby scripts." t)
(setq auto-mode-alist (cons '(".rb$" . ruby-mode) auto-mode-alist))
then when i open .rb file, it looks pretty good with color code and everything, except when i try to save the file, it gives me:
Symbol's value as variable is void: ruby-insert-encoding-magic-comment
how can I solve this. i don't know Lisp (took course, but totally forgot:)
my emacs version is: 22.1.1 machine is macbook os x 10.10
thanks.
ruby-insert-encoding-magic-comment
is defined (e.g.grep
for it). And then make sure that file gets loaded also, whenever the code that uses that variable is loaded. (This is a general thing.) – Drew