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:
- Upgrade Ruby to 1.8.4, or
- 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