MacRuby tweaks to your customized .irbrc

19 03 2011

I started playing with MacRuby this evening. macirb wouldn’t run with my customized .irbrc and gave the following error:

/usr/local/bin/macirb:60:in `block': No such file or directory - open() failed (Errno::ENOENT)
	from /usr/local/bin/macirb:9:in `block'
	from /usr/local/bin/macirb:7:in `
'


If you’re seeing this, you need to do something like this:

# preserve history across irb executions:
require 'irb/completion'
unless 'macruby' == RUBY_ENGINE
  require 'irb/ext/save-history'
  ARGV.concat [ "--readline"]
end
IRB.conf[:SAVE_HISTORY] = 100
IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-save-history"

What I changed was to add lines 2 and 5 from that excerpt, making lines 3 and 4 only run if I’m *not* using macirb. If you’re getting the same error from macirb, this (or something similar) should fix it.


Actions

Informations

Leave a comment

You can use these tags : <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>