Rails was patched to prevent that error.

If you are like me, you develop your applications on Windows and deploy to Linux/Unix/FreeBSD, whatever.

On Rails 1.1, the console does not start anymore on Windows. It reports the following error:

1 $ ruby script\console
2 Loading development environment.
3 c:/ruby/lib/ruby/1.8/irb/init.rb:151:in `parse_opts': undefined method `upcase' for nil:NilClass (NoMethodError)
4         from c:/ruby/lib/ruby/1.8/irb/init.rb:19:in `setup'
5         from c:/ruby/lib/ruby/1.8/irb.rb:54:in `start'
6         from c:/ruby/bin/irb:13

There are two ways to fix this issue:

  1. Upgrade Ruby to 1.8.4, or
  2. Patch your vendor/rails/railties/lib/commands/console.rb to remove the “—prompt-mode single” option:

     1 Index: vendor/rails/railties/lib/commands/console.rb
     2 ===================================================================
     3 --- vendor/rails/railties/lib/commands/console.rb       (revision 4097)
     4 +++ vendor/rails/railties/lib/commands/console.rb       (working copy)
     5 @@ -22,4 +22,4 @@
     6  else
     7    puts "Loading #{ENV['RAILS_ENV']} environment."
     8  end
     9 -exec "#{options[:irb]} #{libs} --prompt-mode simple"
    10 +exec "#{options[:irb]} #{libs}"
    
    


    1 Index: vendor/rails/railties/lib/commands/console.rb
    2 ===============
    3 —- vendor/rails/railties/lib/commands/console.rb (revision 4097)
    4 + vendor/rails/railties/lib/commands/console.rb (working copy)
    5 @</span> -22,4 +22,4 <span class="chg">@
    6 else
    7 puts "Loading #{ENV[‘RAILS_ENV’]} environment."
    8 end
    9 -exec "#{options[:irb]} #{libs} —prompt-mode simple"
    10 +exec "#{options[:irb]} #{libs}"

UPDATE (2006-03-30): Ah, I just found the reason why irb chokes. Richard Livsey’s script/console with edge Rails on Windows with 1.8.2

Search

Your Host

A picture of me

I am François Beausoleil, a Ruby on Rails and Scala developer. During the day, I work on Seevibes, a platform to measure social interactions related to TV shows. At night, I am interested many things. Read my biography.

Top Tags

Books I read and recommend

Links

Projects I work on

Projects I worked on