This project is archived and is in readonly mode.

#3999 ✓committed
Rollo Tomazzi

Rails 2.3.5 on Windows: script/dbconsole cannot find sqlite3

Reported by Rollo Tomazzi | February 19th, 2010 @ 10:00 AM

When using Rails 2.3.5 with the default sqlite3, issuing the following command will redirect you into the sqlite3 command interpreter:

c:\test\test_rails>ruby script/dbconsole

This command fails if you have Ruby installed via the RubyInstaller . In order to avoid this error, a patch should be issued for railties\lib\commands\dbconsole.rb

More info If you have a look at dbconsole.rb in the railties (in the rails gem directory, inside lib\commands), you can see that in order to locate the sqlite3 command interpreter (or any other, because the code is generic), the find_cmd method will look into the path environment variable. For windows, executable files have an ".exe" extension so this is added to the lookup string.
The way this test is done is to parse the RUBY_PLATFORM variable and see whether it contains "win32".
The trouble here is that the above test will fail if you installed Ruby via a different installer. For example, RubyInstaller will set your RUBY_PLATFORM to "i386-mingw32".
I don't have a 64-bits system, but presumably this should also be taken into account here (eg RUBY_PLATFORM =~ /win64/?).

Thanks,
Rollo

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Attachments

Tags

Referenced by

Pages