Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6044573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:01:37+00:00 2026-05-23T07:01:37+00:00

How can I run a ruby piece of code from a buffer, without actually

  • 0

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 ruby code
d) “compile” the buffer and print results in another buffer. I don’t want to save the buffer contents in a file and then “compile” that file

UPDATE 1-9-2011
Which are the latest versions of ruby-mode and inf-ruby and where can I get them? I use the ubuntu natty version of ruby mode and the elpa version of inf-ruby of emacs 23.2. On a clean emacs config, the following config (see underneath) fail with:

can't convert nil into String 
from (irb):1:in `eval' 
from (irb):1". 

Configuration is just the following, no other configuration directives in emacs.d:

(require 'ruby-mode)
(load-file "Configs/.emacs.d/elpa/inf-ruby-2.1/inf-ruby.el")

(autoload 'inf-ruby "inf-ruby" "Run an inferior Ruby pathrocess" t)
(autoload 'inf-ruby-keys "inf-ruby" "" t)
(eval-after-load 'ruby-mode
  '(add-hook 'ruby-mode-hook 'inf-ruby-keys))
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T07:01:38+00:00Added an answer on May 23, 2026 at 7:01 am

    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
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can run Bash shell commands from with a Ruby program or irb using
how can I run ruby code inside javascript in haml? if I use var
Is there a JSP script I can run to point to a JPEG file
how can I save a java applet from a website so I can run
On windows, I can run my ruby script like this: > ruby myscript.rb but
Given that both Ruby on Rails (RoR) and Grails can run on the JVM
Is it possible to run Ruby IRB ver a named pipe, so I can
Maybe I'm missing something simple here, but when I run ruby script/server, I can
So with RVM, you can run different versions Ruby i.e. 1.8.7 or 1.9.2 Within
I am trying to write a simple Ruby program that I will run from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.