run ruby from emacs buffer

前端 未结 2 471
独厮守ぢ
独厮守ぢ 2021-02-08 12:13

How can I run a ruby piece of code from a buffer, without actually saving the buffer in a file? A scenario would be to a) switch to the scratch buffer b) M-x ruby-mode c) type

相关标签:
2条回答
  • 2021-02-08 12:24

    A few options for you to try

    1. Rinari from Github

    It claims to be

    aimed towards making Emacs into a top-notch Ruby and Rails development environment


    2. ruby-compilation.el is what you need.

    There's a thread on that here which I have used and found helpful.

    Chris

    0 讨论(0)
  • 2021-02-08 12:29

    You can do this with inf-ruby.el.

    With inf-ruby installed, M-x inf-ruby starts a new ruby interpreter in the background, to which you can send code using the ruby-send-* commands, such as ruby-send-region (bound by default to C-c C-r). To send the whole buffer, select all with C-x h then hit C-c C-r.

    Update, 2011-09-02: The latest version of inf-ruby.el (2.1.1, available in ELPA) is that maintained by 'nonsequitur' on github, and snapshot packages are available in Melpa.

    0 讨论(0)
提交回复
热议问题