This project is archived and is in readonly mode.
The dbconsole can't exec the db command successfully.
Reported by xpol | November 28th, 2008 @ 09:13 AM | in 2.3.4
System:
Microsoft Windows XP [Version 5.1.2600] Rails 2.2.2 gem 1.3.1 PATH=D:\bin\Ruby\1.8\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;
Steps:
- Put sqlite3.exe and sqlite3.dll in the ruby bin dir.
- Ensure the ruby bin dir is in PATH.
- Create a rails app with all default options.
>rails demo
- Invoke the dbconsole
>cd demo
>ruby script\dbconsole
and the I got the follow output:
D:/bin/Ruby/1.8/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/commands/dbconsole.rb:64:in `exec': No such file or directory - sqlite3.exe (Errno::ENOENT)
from D:/bin/Ruby/1.8/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/commands/dbconsole.rb:64
from D:/bin/Ruby/1.8/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from D:/bin/Ruby/1.8/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from script/dbconsole:3
Suggested solution:
The gems\rails-2.2.2\lib\commands\dbconsole.rb (22): find_cmd function would return the full path of the db command.
This find_cmd works fine for me. (Sorry, I use Windows that don't have a easy-to-use git)
def find_cmd(*commands)
dirs_on_path = ENV['PATH'].to_s.split(File::PATH_SEPARATOR)
commands += commands.map{|cmd| "#{cmd}.exe"} if RUBY_PLATFORM =~ /win32/
full_path_command = nil
found = commands.detect do |cmd|
dir = dirs_on_path.detect do |path|
full_path_command = File.join(path, cmd)
File.executable? full_path_command
end
end
found ? full_path_command : abort("Couldn't find database client: #{commands.join(', ')}. Check your $PATH and try again.")
end
Comments and changes to this ticket
-
paolo January 8th, 2009 @ 10:31 AM
Hi,
I get the same error as referred in the ticket..
C:\jite_2k9>ruby script/dbconsole C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/commands/dbconsole.rb:63:in
exe ': No such file or directory - sqlite3.exe (Errno::ENOENT)
from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/commands/dbconsole.
b:63
from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `g
m_original_require'
from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `r
quire'
from script/dbconsole:3
C:\jite_2k9>sqlite3 SQLite version 3.6.7 Enter ".help" for instructions Enter SQL statements terminated with a ";" sqlite>
-
Pratik March 8th, 2009 @ 05:01 PM
- Assigned user set to Pratik
- State changed from new to incomplete
Could you please submit a patch using git-format-patch ? http://guides.rails.info/contrib... should help.
Thanks!
-
CancelProfileIsBroken August 5th, 2009 @ 03:22 PM
- Tag changed from 2.2.2, dbconsole, windows to 2.2.2, bugmash, dbconsole, windows
-
Kamal Fariz August 10th, 2009 @ 07:15 AM
I've generated the patch for the amended find_cmd. This patch works in both 2-3-stable and master.
-
Kamal Fariz August 10th, 2009 @ 07:19 AM
- Tag changed from 2.2.2, bugmash, dbconsole, windows to 2.2.2, bugmash, dbconsole, patch, windows
At the risk of spamming the ticket, I left out the obligatory bugmash magic phrase:
I've attached a patch.
-
Jeremy Kemper August 10th, 2009 @ 08:05 AM
- State changed from incomplete to committed
- Tag changed from 2.2.2, bugmash, dbconsole, patch, windows to 2.2.2, dbconsole, patch, windows
- Milestone changed from 2.x to 2.3.4
-
Repository August 10th, 2009 @ 08:05 AM
(from [9284bcc35a6431a6044da2b608998b83e4fb1f9b]) find_cmd should return the full path of the db command
[#1488 state:committed]
Signed-off-by: Jeremy Kemper jeremy@bitsweat.net
http://github.com/rails/rails/commit/9284bcc35a6431a6044da2b608998b... -
Repository August 10th, 2009 @ 08:05 AM
(from [600a89f2082beadf4af9fe140a1a2ae56386cd49]) find_cmd should return the full path of the db command
[#1488 state:committed]
Signed-off-by: Jeremy Kemper jeremy@bitsweat.net
http://github.com/rails/rails/commit/600a89f2082beadf4af9fe140a1a2a...
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
Referenced by
- 1488 The dbconsole can't exec the db command successfully. [#1488 state:committed]
- 1488 The dbconsole can't exec the db command successfully. [#1488 state:committed]