Rails 1.1 Console on Windows

March 30th, 2006

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
2
3
4
5
6
$ ruby script\console
Loading development environment.
c:/ruby/lib/ruby/1.8/irb/init.rb:151:in `parse_opts': undefined method `upcase' for nil:NilClass (NoMethodError)
        from c:/ruby/lib/ruby/1.8/irb/init.rb:19:in `setup'
        from c:/ruby/lib/ruby/1.8/irb.rb:54:in `start'
        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
    2
    3
    4
    5
    6
    7
    8
    9
    10
    
    Index: vendor/rails/railties/lib/commands/console.rb
    ===================================================================
    --- vendor/rails/railties/lib/commands/console.rb       (revision 4097)
    +++ vendor/rails/railties/lib/commands/console.rb       (working copy)
    @@ -22,4 +22,4 @@
     else
       puts "Loading #{ENV['RAILS_ENV']} environment."
     end
    -exec "#{options[:irb]} #{libs} --prompt-mode simple"
    +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

A picture of me

I am François Beausoleil, a Ruby on Rails coder. During the day, I work on XLsuite. At night, I am interested many things. Read my biography

Tags

(3) (1) (0) (2) (1) (1) (2) (2) (1) (2) (1) (2) (1) (2) (1) (1) (1) (1) (2) (14) (1) (1) (1) (1) (2) (1) (1) (2) (0) (1) (2) (1) (3) (1) (1) (1) (1) (1) (1) (0) (3) (2) (1) (2) (2) (1) (3) (2) (8) (8) (9) (12) (1) (1) (3) (1) (1) (1) (1) (1) (1) (2) (2) (2) (1) (1) (3) (1) (3) (1) (0) (23) (1) (1) (0) (1) (1) (1) (23) (25) (1) (1) (13) (1) (1) (2) (3) (1) (1) (4) (1) (2) (3) (0) (1) (7) (3) (1) (5) (5) (2) (2) (2) (4) (6) (7) (1) (0) (1) (1) (2) (2) (1) (4) (12) (2) (1) (2) (4) (1) (1) (1) (2) (8) (2) (3) (2) (2) (1) (3) (1) (1)

Links

Projects I work on

Categories

Archives