有哪些最佳模式,配置设置或任何能够更好地在emacs上开发ruby on rails应用程序。
答案 0 :(得分:29)
你应该尝试所有的RoR并选择你最喜欢的那个。
首先,您应该使用ECB,ruby-mode,emacs-rails和其他一些内容查看Marshall Vandegrift的excellent screencast。它让你对Emacs上写RoR的酷感很好。
总之,这里有一些你应该尝试的模式:
以下是一些有用的其他模式:
您可以尝试更多模式:
哦,当然你需要ruby-mode,它带有ruby源,由Matz自己维护。
希望这有帮助
答案 1 :(得分:6)
rspec-mode
(轻松运行单个或多个规格)
js2-mode
(JavaScript语法高亮显示)
ido
(快速查找项目中的文件/缓冲区)
答案 2 :(得分:4)
由于我是rails(和emacs)的新手,我不想马上使用rinari。我发现,如果一个工具对我来说太过神奇,我就不会像我想的那样快速地学习细节。我想我最终会用它。但是现在,我设置了一堆shell,我在emacs中为RAILS 3生成,只是在它们之间切换以完成我的工作。我用tmr作为前缀,以便我可以轻松找到它们。
(defun tmr-spork-shell ()
"Invoke spork shell" ; Spork - love that name
(interactive)
(pop-to-buffer (get-buffer-create (generate-new-buffer-name "spork")))
(shell (current-buffer))
(process-send-string nil "cd .\n"); makes sure rvm variables set with .rvmrc
(process-send-string nil "spork\n"))
(defun tmr-devlog-shell ()
"Tail the development log, shell"
(interactive)
(pop-to-buffer (get-buffer-create (generate-new-buffer-name "devlog")))
(shell (current-buffer))
(process-send-string nil "cd .\n"); makes sure rvm variables set with .rvmrc
(process-send-string nil "tail -f log/development.log\n"))
(defun tmr-testlog-shell ()
"Tail the test log, shell"
(interactive)
(pop-to-buffer (get-buffer-create (generate-new-buffer-name "testlog")))
(shell (current-buffer))
(process-send-string nil "cd .\n"); makes sure rvm variables set with .rvmrc
(process-send-string nil "tail -f log/test.log\n"))
(defun tmr-server-shell ()
"Invoke rails ui server shell"
(interactive)
(pop-to-buffer (get-buffer-create (generate-new-buffer-name "server")))
(shell (current-buffer))
(process-send-string nil "cd .\n"); makes sure rvm variables set with .rvmrc
(process-send-string nil "rails s\n"))
(defun tmr-db-shell ()
"Invoke rails dbconsole shell"
(interactive)
(pop-to-buffer (get-buffer-create (generate-new-buffer-name "dbconsole")))
(shell (current-buffer))
(process-send-string nil "cd .\n"); makes sure rvm variables set with .rvmrc
(process-send-string nil "rails dbconsole\n"))
(defun tmr-console-shell ()
"Invoke rails console shell"
(interactive)
(pop-to-buffer (get-buffer-create (generate-new-buffer-name "console")))
(shell (current-buffer))
(process-send-string nil "cd .\n"); makes sure rvm variables set with .rvmrc
(process-send-string nil "rails console\n"))
; I like to run all my tests in the same shell
(defun tmr-rspec-shell ()
"Invoke rspec shell"
(interactive)
(pop-to-buffer (get-buffer-create (generate-new-buffer-name "rspec")))
(shell (current-buffer))
(process-send-string nil "cd .\n"); makes sure rvm variables set with .rvmrc
(process-send-string nil "rspec spec\n")) ; This is debatable, since spork wont be up yet
; The shell where I do most of my work
(defun tmr-shell ()
"Invoke plain old shell"
(interactive)
(pop-to-buffer (get-buffer-create (generate-new-buffer-name "sh")))
(shell (current-buffer))
(process-send-string nil "cd .\n")); makes sure rvm variables set with .rvmrc
; My everyday ide
(defun tmr-ide-lite ()
"Spawn several shells for a mini Rails IDE"
(interactive)
(progn (tmr-spork-shell)
(tmr-shell)
(tmr-server-shell)
(tmr-rspec-shell)))
; When I am doing a big debug session
(defun tmr-ide-full ()
"Spawn several shells for a full Rails IDE"
(interactive)
(progn (tmr-spork-shell)
(tmr-shell)
(tmr-server-shell)
(tmr-console-shell)
(tmr-db-shell)
(tmr-devlog-shell)
(tmr-testlog-shell)
(tmr-rspec-shell)))
答案 3 :(得分:3)
我觉得有用的另一种模式是web-mode
。它对于编写视图很有用,并且可以很好地处理.html.erb文件。它具有语法高亮和标签完成等功能。您可以在here找到它。