Home > Something Interesting I found > Ruby On Rails 3.0 on Windows Fix

Ruby On Rails 3.0 on Windows Fix

February 17th, 2010 Leave a comment Go to comments

On windows Ruby on Rails 3 new commands: rails server, does not work. I hope this is fixed in the released RoR 3.0 but until then, I’ve created a quick and dirty hack.

Create a file in the application ROOT called rails.rb. In the file add the following lines:

command = “ruby script\rails”
$arguments = nil

ARGV.each do |arg|
$arguments = “#{$arguments}” + “#{arg} ”
end

system( “#{command} #{$arguments}” )

Now you can call from a command prompt rails server or any other like rails g controller Post.

Categories: Something Interesting I found Tags:
  • Paul

    Be sure to escape the backslash (\) or use a forward slash, or else you'll get a cryptic error message because of the carriage return (r).

    Either way, thanks, this solved the exact issue I was having!