Monday, November 7, 2011

Install Ruby goodies for ruby 1.9.3 on Windows

If you install Ruby 1.9.3 on Windows from source, there are two lacked features - readline and debugger. This article introduces using these features in Ruby 1.9.3 on Windows.

readline

If you are a specialist of cygwin or mingw, you may also build readline from source. But, there are an easier way - installing rb-readline.
> gem install rb-readline
And you should check rb-readline is active like below:
> irb --readline -r irb/completion

debugger

In short: check this post. In more detail, let's do three installation like below:
  1. Download linecache19 (0.5.13 or above) from here, then
    > gem install linecache19-0.5.13.gem
    at last check that c:/ruby-1.9.3/include/ruby-1.9.1/ruby-1.9.3-p0 is created.
  2. Download ruby-debug-base19 (0.11.26 or above) from here, then
    > gem install ruby-debug-base19-0.11.26.gem -- --with-ruby-include=c:/ruby-1.9.3/include/ruby-1.9.1/ruby-1.9.3-p0
  3. > gem install ruby-debug19

If you want to manage these features in Rails3

Edit for your Gemfile on your app like below:
group :development do
  gem 'rb-readline'
  gem 'ruby-debug19', require: 'ruby-debug'
end

No comments:

Post a Comment