Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQLite3::CantOpenException: unable to open database file (Sequel: :DatabaseConnectionError) #120

Open
murtyk opened this issue Sep 28, 2012 · 12 comments

Comments

@murtyk
Copy link

murtyk commented Sep 28, 2012

I tried taps today and getting the following error. Found from one of the past issues that the cwd should have write access and made sure that it has write access. I am still getting this error. Appreciate if anyone can help.

$taps server sqlite://db/development.sqlite3 railsdev railsdev
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sequel-3.20.0/lib/sequel/adapters/sqlite.rb:62:in initialize': SQLite3::CantOpenException: unable to open database file (Sequel: :DatabaseConnectionError) from C:/Ruby193/lib/ruby/gems/1.9.1/gems/sequel-3.20.0/lib/sequel/adapters/sqlite.rb:62:innew'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/sequel-3.20.0/lib/sequel/adapters/sqlite.rb:62:in connect' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/sequel-3.20.0/lib/sequel/database/misc.rb:45:inblock in initialize'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/sequel-3.20.0/lib/sequel/connection_pool.rb:92:in call' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/sequel-3.20.0/lib/sequel/connection_pool.rb:92:inmake_new'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/sequel-3.20.0/lib/sequel/connection_pool/threaded.rb:126:in make_new' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/sequel-3.20.0/lib/sequel/connection_pool/threaded.rb:112:inavailable'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/sequel-3.20.0/lib/sequel/connection_pool/threaded.rb:102:in block in acquire' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/sequel-3.20.0/lib/sequel/connection_pool/threaded.rb:146:inblock in sync'
from internal:prelude:10:in synchronize' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/sequel-3.20.0/lib/sequel/connection_pool/threaded.rb:146:insync'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/sequel-3.20.0/lib/sequel/connection_pool/threaded.rb:101:in acquire' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/sequel-3.20.0/lib/sequel/connection_pool/threaded.rb:74:inhold'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/sequel-3.20.0/lib/sequel/database/connecting.rb:226:in synchronize' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/sequel-3.20.0/lib/sequel/adapters/sqlite.rb:94:inexecute_ddl'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/sequel-3.20.0/lib/sequel/database/schema_methods.rb:320:in create_table_from_generator' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/sequel-3.20.0/lib/sequel/database/schema_methods.rb:94:increate_table'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/sequel-3.20.0/lib/sequel/plugins/schema.rb:24:in create_table' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/sequel-3.20.0/lib/sequel/plugins/schema.rb:33:increate_table!'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/taps-0.3.24/lib/taps/db_session.rb:20:in <top (required)>' from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:inrequire'
from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in require' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/taps-0.3.24/lib/taps/server.rb:4:in<top (required)>'
from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in require' from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:inrequire'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/taps-0.3.24/lib/taps/cli.rb:61:in server' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/taps-0.3.24/lib/taps/cli.rb:27:inrun'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/taps-0.3.24/bin/taps:6:in <top (required)>' from C:/Ruby193/bin/taps:23:inload'
from C:/Ruby193/bin/taps:23:in `

'

@TRoam
Copy link

TRoam commented Jan 21, 2013

I have the same error, how do you solved it?

@murtyk
Copy link
Author

murtyk commented Jan 24, 2013

Sorry, I don't remember exactly what happened but I changed my dev db to postgres. I have not encountered this problem again. sorry, can't be much help.

@TRoam
Copy link

TRoam commented Jan 25, 2013

Thank you all the same.

@foton
Copy link

foton commented Feb 12, 2013

I have my dev DB in MySQL and want to convert it to Postgres.
Have the same error (Sqlite3) even usinq MySQL :
taps server mysql://dbuser:dbpasswd@localhost/database_name conver_user convert_psswd

@askehansen
Copy link

I had the same issue.. Turns out you need to have three trailing slashes after sqlite:
So you change taps server sqlite://db/development.sqlite3 railsdev railsdevto taps server sqlite:///db/development.sqlite3 railsdev railsdev

@me-programmers
Copy link

I had the same issue too. I am using windows 8, ruby 1.9.3, rails 3.2
I am already try all solution in this thread.

@ezuhaib
Copy link

ezuhaib commented Feb 11, 2014

If you are in the application root, you do not need three trailing slashes... just two.

I'm having this issue. Not able to solve.

sequel sqlite://db/development.rb 

works fine however.

@emclab
Copy link

emclab commented Feb 18, 2014

Having the same issue on Windows 8, ruby 2.0.0 and rails 3.2.12. Tried all solution in this thread.

@danascheider
Copy link

I am not using Taps and am having basically the identical problem, so I think the issue may be with one of the other gems. I'm using Sequel 4.14.0, Sinatra 1.4.5, SQLite3 1.3.9, and Ruby 2.1.2. I wish I could give more information than that!

@sammarxz
Copy link

Test with "sudo" first

@aussiDavid
Copy link

I got this error when using a symlink.

@ashleymichal
Copy link

the path after sqlite3:// is as you would type it in to your terminal. so, /db/... will look for a directory named db at the root of your system, which is likely not what you want if you are setting up a development db. db/... on the other hand will look for a directory named db at the root of your project or wherever the configuration is invoked. It will not make the directory for you, though.

TL;DR - all you have to do is add a db directory at the root of your project. Then the recommended sqlite://db/... will work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests