This project is archived and is in readonly mode.
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
-
Rollo Tomazzi February 19th, 2010 @ 10:13 AM
Hello,
For good measure, I've also created a ticket 27858 in the RubyInstaller project at Rubyforge.
Thanks,
Rollo -
Rollo Tomazzi February 19th, 2010 @ 02:48 PM
Okay, so Luis at RubyForge has clarified the issue.
The way dbconsole.find_cmd identifies the Windows environment is definitely not the way it should be. Information related to the simple fix to be implemented is here: http://blog.emptyway.com/2009/11/03/proper-way-to-detect-windows-
platform-in-ruby/
Looks simple enough.Thanks,
Rollo -
Rollo Tomazzi February 19th, 2010 @ 02:50 PM
Should have used Markdown for the link. Here it is: proper-way-to-detect-windows-platform-in-ruby
-
Andrew Grimm April 25th, 2010 @ 12:24 PM
The bad news: I created a duplicate with #4470
The good news: I supplied a patch. -
Andrew Grimm April 26th, 2010 @ 05:36 AM
- no changes were found...
-
Anil Wadghule April 26th, 2010 @ 12:12 PM
- Assigned user set to Jeremy Kemper
-
Repository April 26th, 2010 @ 07:08 PM
- State changed from new to committed
(from [e813ad2a42549e308a69fd9473f1b9ed531a0d7e]) Make db console work for all versions of ruby on Windows.
[#3999 state:committed]
Signed-off-by: Jeremy Kemper jeremy@bitsweat.net
http://github.com/rails/rails/commit/e813ad2a42549e308a69fd9473f1b9...
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>
People watching this ticket
Attachments
Tags
Referenced by
- 4470 DB console doesn't run for all Windows-based ruby implementations I've just realized that this is a duplicate of #3999. I t...
- 4470 DB console doesn't run for all Windows-based ruby implementations Duplicate of #3999. Please attach the patch there.
- 4477 Use rbconfig's Config::CONFIG['host_os'] instead of RUBY_PLATFORM With reference to ticket & patch #3999. And as per sugges...
- 4477 Use rbconfig's Config::CONFIG['host_os'] instead of RUBY_PLATFORM I haven't changed the file which #3999 patch fixes, so #3...
- 4477 Use rbconfig's Config::CONFIG['host_os'] instead of RUBY_PLATFORM I haven't changed the file which #3999 patch fixes, so #3...
- 3999 Rails 2.3.5 on Windows: script/dbconsole cannot find sqlite3 [#3999 state:committed]