Comments (10)
I don't think the patch above works well, since it doesn't work in cases in which the db config can't easily been taken from database.yml (for instance, when database info is encrypted in secrets, etc).
For me, I ran into this one when using rvm. Rvm wasn't loading with the 'rails' command, so it wasn't found. Strange how it wasn't reporting anything out, though.
This fixed it for me:
set :rvm_map_bins, %w{gem rake ruby bundle rails}
from capistrano-db-tasks.
I am having the same issue, this is what logs say:
DEBUG [fc953976] Finished in 0.547 seconds with exit status 0 (successful). INFO Loading local database config INFO Loading local database config INFO Loading remote database config DEBUG [3b1a9656] Running if test ! -d /home/ubuntu/current; then echo "Directory does not exist '/home/ubuntu/current'" 1>&2; false; fi as $SERVER$ DEBUG [3b1a9656] Command: if test ! -d /home/ubuntu/current; then echo "Directory does not exist '/home/ubuntu/current'" 1>&2; false; fi DEBUG [3b1a9656] Finished in 0.243 seconds with exit status 0 (successful). DEBUG [61adb49d] Running bundle exec rails runner "puts '__CAPISTRANODB_CONFIG_BEGIN_FLAG__' + ActiveRecord::Base.connection.instance_variable_get(:@config).to_yaml + '__CAPISTRANODB_CONFIG_END_FLAG__'" 2>/dev/null as $SERVER$ DEBUG [61adb49d] Command: cd /home/ubuntu/current && ( export RAILS_ENV="production" ; bundle exec rails runner "puts '__CAPISTRANODB_CONFIG_BEGIN_FLAG__' + ActiveRecord::Base.connection.instance_variable_get(:@config).to_yaml + '__CAPISTRANODB_CONFIG_END_FLAG__'" 2>/dev/null )
from capistrano-db-tasks.
i m too.
Error running command (status=pid 5691 exit 1): /home/luiz/projects/exercicios_resolvidos5/bin/rails runner "puts '__CAPISTRANODB_CONFIG_BEGIN_FLAG__' + ActiveRecord::Base.connection.instance_variable_get(:@config).to_yaml + '__CAPISTRANODB_CONFIG_END_FLAG__'"
ruby: 2.6
rails: 5.1
capistrano-db-tasks: 0.6
database: postgress in another machine
from capistrano-db-tasks.
@sgruhier - I get the same error, is there any updates on when this is gonna be fixed?
from capistrano-db-tasks.
I'm also experiencing the same behavior. db:pull fails unless I force version 0.4.
For me at least, this didn't start happening until I updated to Capistrano 3.8.1. Having said that, I'm not exactly a ruby on rails guru and that might have not a damn thing to do with anything...
from capistrano-db-tasks.
The fix above from @sauliusgrigaitis worked for me. Thank you!
from capistrano-db-tasks.
Can we merge this into master and create a new release?
I verified that @sauliusgrigaitis fix works.
from capistrano-db-tasks.
By the way, if you want to use the fix before they merge it into a release, you can do the following:
- In command prompt type "which rails"
- Change to the directory using the "cd" command.
- There is a gem folder. Traverse the folder until you find database.rb. Copy paste the file from the fix into there. This will make it work, however, the solution is temporary.
from capistrano-db-tasks.
from capistrano-db-tasks.
There are 2 issues here.
- For those who are using capistrano-rvm, make sure that you've set:
set :rvm_map_bins, %w{gem rake ruby bundle rails}
This enables capistrano-db-tasks to run rails runner using the bins provided by RVM.
- For those who have things in the DB being loaded by Rails before running (eg. application settings saved in the DB, which doesn't exist yet, because you're trying to set-up the DB but you can't setup the DB because cap db:push doesn't work because rails runner doesn't run because of an application setting in the db, which doesn't exist yet...), this commit will fix it naively as it forgoes going through
rails runner
but instead assumes a config/database.yml being read.
This case will fail for those who have a different setup (e.g. creds in secrets.yml) (as #113 (comment) points out)
from capistrano-db-tasks.
Related Issues (20)
- undefined method `zone' for Time:Class HOT 2
- NoMethodError: undefined method `zone' for Time:Class HOT 2
- SSHKit::Runner::ExecuteError "rails exit status: 127" in versions 0.5 and 0.6 HOT 11
- Net::SCP failure when db_dump_dir is set HOT 2
- NoMethodError: undefined method `[]' for nil:NilClass HOT 1
- how do I pass credentials to pg_dump?
- Option to drop database before import HOT 2
- Note in Docs for use with capistrano-rvm
- istrano HOT 2
- cap staging db:pull causes this problem :( HOT 2
- Serial id lost after db push HOT 2
- scp should happen before remote clean HOT 1
- Doesn't work on winows 10 sub-systems (/usr/bin/env: ‘ruby.exe’: No such file or directory)
- Strip adapter check? HOT 2
- Can not accept `db_dump_dir` configuration HOT 1
- Append the `db:download` task
- Multi database support is broken
- Question to users HOT 2
- `db_ignore_data_tables` setting doesn't work on MySQL
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from capistrano-db-tasks.