emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-babel ruby 1.8 and 1.9
@ 2011-09-19  0:50 Steve Harman
  2011-09-19  2:45 ` Eric Schulte
  0 siblings, 1 reply; 2+ messages in thread
From: Steve Harman @ 2011-09-19  0:50 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 905 bytes --]

Hello,

On my mac, I have rvm installed with ruby 1.9.2 being default.
On the terminal, if I execute ruby, it is always 1.9.2 version.
However, the ruby ran by org-babel is 1.8 version.
How can I make the ruby code blocks in my org files
executed by 1.9?

Since I am new to Emacs, I would appreciate your help.
I found org-mode and org-babel extremely helpful in preparing
course notes. That's why, in fact, I switched to Emacs.
In an attempt to solve the above problem, I installed rvm.el
and put it in my init.el right before loading the org-babel languages.

(add-to-list 'load-path "/Users/stvharman/.emacs.d/lisp/rvm")
(require 'rvm)
(rvm-use-default) ;; use rvm’s default ruby for the current Emacs session

(org-babel-do-load-languages
 'org-babel-load-languages
 '(
   (R . t)
   (ruby . t)
    ))

Thank you in advance.

Have a nice weekend (and week ahead),

Steve

[-- Attachment #2: Type: text/html, Size: 1008 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: org-babel ruby 1.8 and 1.9
  2011-09-19  0:50 org-babel ruby 1.8 and 1.9 Steve Harman
@ 2011-09-19  2:45 ` Eric Schulte
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Schulte @ 2011-09-19  2:45 UTC (permalink / raw)
  To: Steve Harman; +Cc: emacs-orgmode

Hi Steve,

You should be able to customize the value of the org-babel-ruby-command
variable to control what external executable is called by ruby code
blocks.  The default value of that variable is simply "ruby" but
presumably setting that variable to the name of the ruby 1.9 executable
should work.

Note that for code blocks which use a session (see the session header
argument for more information) all execution is handled by inf-ruby, and
the inf-ruby package controls which executable is used.

Hope this helps

Best -- Eric

Steve Harman <stvharman@gmail.com> writes:

> Hello,
>
> On my mac, I have rvm installed with ruby 1.9.2 being default.
> On the terminal, if I execute ruby, it is always 1.9.2 version.
> However, the ruby ran by org-babel is 1.8 version.
> How can I make the ruby code blocks in my org files
> executed by 1.9?
>
> Since I am new to Emacs, I would appreciate your help.
> I found org-mode and org-babel extremely helpful in preparing
> course notes. That's why, in fact, I switched to Emacs.
> In an attempt to solve the above problem, I installed rvm.el
> and put it in my init.el right before loading the org-babel languages.
>
> (add-to-list 'load-path "/Users/stvharman/.emacs.d/lisp/rvm")
> (require 'rvm)
> (rvm-use-default) ;; use rvm’s default ruby for the current Emacs session
>
> (org-babel-do-load-languages
>  'org-babel-load-languages
>  '(
>    (R . t)
>    (ruby . t)
>     ))
>
> Thank you in advance.
>
> Have a nice weekend (and week ahead),
>
> Steve

-- 
Eric Schulte
http://cs.unm.edu/~eschulte/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-09-19  2:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-19  0:50 org-babel ruby 1.8 and 1.9 Steve Harman
2011-09-19  2:45 ` Eric Schulte

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).