Hello.

I do warm on a remote server. When deploying, I start the migration (cap production deploy: migrate), gives the following error:

Command: cd /home/deploy/sudoku/current && ( export RACK_ENV="" ; bundle exec rake db:migrate ) DEBUG [7fadeecc] rake aborted! DEBUG [7fadeecc] ActiveRecord::AdapterNotSpecified: database configuration does not specify adapter DEBUG [7fadeecc] /home/deploy/sudoku/shared/bundle/ruby/2.3.0/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/connection_specification.rb:170:in `spec' /home/deploy/sudoku/shared/bundle/ruby/2.3.0/gems/activerecord-5.0.0.1/lib/active_record/connection_handling.rb:53:in `establish_connection' /home/deploy/sudoku/shared/bundle/ruby/2.3.0/gems/sinatra-activerecord-2.0.11/lib/sinatra/activerecord.rb:50:in `database=' /home/deploy/sudoku/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:1217:in `set' /home/deploy/sudoku/shared/bundle/ruby/2.3.0/gems/sinatra-activerecord-2.0.11/lib/sinatra/activerecord.rb:41:in `database_file=' /home/deploy/sudoku/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:1217:in `set' /home/deploy/sudoku/shared/bundle/ruby/2.3.0/gems/sinatra-activerecord-2.0.11/lib/sinatra/activerecord.rb:22:in `registered' /home/deploy/sudoku/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:1400:in `block in register' /home/deploy/sudoku/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:1398:in `each' /home/deploy/sudoku/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:1398:in `register' /home/deploy/sudoku/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:1969:in `register' /home/deploy/sudoku/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:2030:in `register' /home/deploy/sudoku/shared/bundle/ruby/2.3.0/gems/sinatra-activerecord-2.0.11/lib/sinatra/activerecord.rb:63:in `<module:Sinatra>' /home/deploy/sudoku/shared/bundle/ruby/2.3.0/gems/sinatra-activerecord-2.0.11/lib/sinatra/activerecord.rb:10:in `<top (required)>' /home/deploy/sudoku/releases/20161216055930/app.rb:3:in `require' /home/deploy/sudoku/releases/20161216055930/app.rb:3:in `<top (required)>' /home/deploy/sudoku/releases/20161216055930/Rakefile:1:in `require' /home/deploy/sudoku/releases/20161216055930/Rakefile:1:in `<top (required)>' /home/deploy/sudoku/shared/bundle/ruby/2.3.0/gems/rake-11.3.0/exe/rake:27:in `<top (required)>' /usr/local/bin/bundle:23:in `load' /usr/local/bin/bundle:23:in `<main>' DEBUG [7fadeecc] (See full trace by running task with --trace) 

Database connection setup:

 development: adapter: "sqlite3" database: "sudoku_database.sqlite3" production: adapter: "sqlite3" database: "../../db/sudoku_database.sqlite3" 

deploy.rb

 lock '3.4.0' set :default_env, { 'RACK_ENV' => "production" } set :application, 'sudoku' set :repo_url, 'git@github.com:user/sudoku.git' set :deploy_to, '/home/deploy/project' #set :linked_files, %w{config/database.yml} set :linked_dirs, %w{ log } namespace :deploy do desc 'Restart application' task :restart do on roles(:app), in: :sequence, wait: 5 do execute :touch, release_path.join('tmp/restart.txt') end end task :migrate do on roles(:app) do within release_path do with rack_env: fetch(:rack_env) do execute :rake, "db:migrate" end end end end #after 'deploy', 'migrate' #after :publishing, 'deploy:restart' #after :finishing, 'deploy:cleanup' end 

On the local server, migrations run smoothly, creating a database with the corresponding tables.

Closed due to the fact that the issue is too general for the participants D-side , user194374, Alex , aleksandr barakin , Grundy 20 Dec '16 at 9:20 .

Please correct the question so that it describes the specific problem with sufficient detail to determine the appropriate answer. Do not ask a few questions at once. See “How to ask a good question?” For clarification. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • #set :linked_files, %w{config/database.yml} commented out? Why? Is it in your repository, or only locally? - D-side
  • is in the repository - Stefan Hansch
  • And where is ActiveRecord::Base.establish_connection ? - D-side

0