Use Emacs as the Ruby on Rails integrated development environment

Source: Internet
Author: User

In the rubyforge projectEmacs-railsPackage: Ruby support for Emacs under the MISC directory in the ruby release.NxhtmL The use of Emacs addon provides strong support for ror project development.

Briefly describe the installation and configuration process:

1.Download the latest emacs-rails package from the rubyforge website. 

2.Download the lisp package on which emacs-rails depends 

* "Http://www.kazmier.com/computer/snippet.el": snippets
* "Http://www.webweavertech.com/ovidiu/emacs/find-recursive.txt": frecursive

3.Place the required lisp package in a unified directory of the load path of Emacs. 

Decompress the emacs-rails compressed file to the Emacs package configuration directory, for example, "$ home /. emacs. d/"or the site-lisp directory under the Emacs directory. decompress the package and generate the emacs-rails directory. I renamed it to rails.

Set * in the MISC directory under the ruby installation directory *. copy the El file to the rails directory. (In readme in the release of emacs-rails, you only need the INF-Ruby package, which may not be clearly explained; it is better to put all files in the MISC directory (at least ruby-electric.el, ruby-mode.el, and inf-ruby.el files ).

Copy the snippet. El and find-recursive.el files to the rails directory.

4.Custom. emacs file 

Add the following content to the. emacs file:
(Setq load-path (Cons "~ /. Emacs. d/rails "load-path ))
(Require 'rails)
(Setq auto-mode-alist
'(
; The following row settings are not mentioned in readme in the release of emacs-rails. Although the development environment can work, files such as *. RB cannot be highlighted in syntax. Therefore, you need to add the following settings.
("//. RB // '". Ruby-mode)
; ...... Other mode Relation
))

5.Install and customize nxhtml Emacs addon 

Nxhtml mode is an extension package of Emacs. It provides rich support for editing web files such as XHTML. It provides multiple major modes to easily process PHP, JSP, eruby and other documents.

Download the latest package from the nxhtml homepage, decompress it to the "$ home/. emacs. d/" directory, and add the following line to. emacs:

(Load "~ /. Emacs. d/nxml/autostart. El ")

You can use it for development. After opening the relevant file, you can press "M-x nxhtml-minor-mode" to open the nxhtml mode. In the nxhtml menu, for more information, see the documentation provided by the website.

References: 

1. Download the emacs-rails package and related files from the rubyforge website.

2. Download the two lisp files on which emacs-rails depends Based on the address provided in step 2 of the installation configuration, note that the second downloaded TXT file is renamed to the find-recursive.el.

3. Download The nxhtml package from the nxhtml site and refer to the instructions for use.

4. Some problems may occur during nxhtml usage. Please go to the emacs-nxml-mode group of Yahoo for help or support.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.