You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
using sinatra 4.0.0 and sinatra-activerecord 2.0.27 I observed this problem:
As long as I don't configure the database in my application, but just have a config/database.yml in the root directory of my application (i.e. the CWD of the running process), things work.
But once I set something like
set :database_file, "config/database.yml"
things break with an error message
Errno::ENOENT: No such file or directory @ rb_sysopen - ${PATH_of_my_Gems_dir}/gems/sinatra-contrib-4.0.0/lib/sinatra/config/database.yml (Errno::ENOENT)
${PATH_of_my_Gems_dir}//gems/sinatra-activerecord-2.0.27/lib/sinatra/activerecord.rb:78:in read' ${PATH_of_my_Gems_dir}//gems/sinatra-activerecord-2.0.27/lib/sinatra/activerecord.rb:78:in database_file='
It then tries to read the database file from a wrong location, i.e. within the gems repository instead of the running application or the CWD where the process was run.
The text was updated successfully, but these errors were encountered:
May I know what was the pwd (present work directory) when you run the rake command? The gem is using "Rake.application.original_dir" as the root directory to find the database file, which from my knowledge, it depends on the pwd when the rake command is invoked. (https://stackoverflow.com/a/260137)
Hi,
using sinatra 4.0.0 and sinatra-activerecord 2.0.27 I observed this problem:
As long as I don't configure the database in my application, but just have a config/database.yml in the root directory of my application (i.e. the CWD of the running process), things work.
But once I set something like
set :database_file, "config/database.yml"
things break with an error message
Errno::ENOENT: No such file or directory @ rb_sysopen - ${PATH_of_my_Gems_dir}/gems/sinatra-contrib-4.0.0/lib/sinatra/config/database.yml (Errno::ENOENT)
${PATH_of_my_Gems_dir}//gems/sinatra-activerecord-2.0.27/lib/sinatra/activerecord.rb:78:in
read' ${PATH_of_my_Gems_dir}//gems/sinatra-activerecord-2.0.27/lib/sinatra/activerecord.rb:78:in
database_file='It then tries to read the database file from a wrong location, i.e. within the gems repository instead of the running application or the CWD where the process was run.
The text was updated successfully, but these errors were encountered: