Ruby Source Code in Org Mode

Menu

Enable execution of ruby code in Org Mode files with the following require in your .emacs file:

(require 'ob-ruby)

You can then insert ruby code in your org file using the following tags:

#+BEGIN_SRC ruby
  a = 2 + 3
  b = 10 * 2
  [a + b, a]
#+END_SRC

Evaluate with C-c C-C … and voila, the result shows in the buffer:

#+RESULTS:
| 25 | 5 |

Author: Adolfo Villafiorita

Last modified: 2020-06-29 Mon 22:41 (created on: 2014-09-28 Sun 00:00)

Published: 2020-06-30 Tue 22:55