Comments (5)
I had a line in my db config that set the db name based on the app name.
database: <%= Rails.application.engine_name.gsub(/_application/,'').downcase %>_development
The Rails constant apparently doesn't exist in the Capistrano scope.
from capistrano-db-tasks.
Here's a full trace:
** Invoke production (first_time)
** Execute production
** Invoke load:defaults (first_time)
** Execute load:defaults
** Invoke rvm:hook (first_time)
** Execute rvm:hook
** Invoke rvm:check (first_time)
** Execute rvm:check
** Invoke bundler:map_bins (first_time)
** Execute bundler:map_bins
** Invoke deploy:set_rails_env (first_time)
** Execute deploy:set_rails_env
** Invoke deploy:set_linked_dirs (first_time)
** Execute deploy:set_linked_dirs
** Invoke deploy:set_rails_env
** Invoke rvm1:hook (first_time)
** Execute rvm1:hook
INFO [402f3357] Running /usr/bin/env mkdir -p /var/www/ilf-cms/rvm1scripts/ as deploy@ilf-web1
INFO [402f3357] Finished in 0.191 seconds with exit status 0 (successful).
INFO Uploading /Users/andrew/.rvm/gems/ruby-2.3.0/gems/rvm1-capistrano3-1.4.0/script/rvm-auto.sh 100.0%
INFO [d6490632] Running /usr/bin/env chmod +x /var/www/ilf-cms/rvm1scripts/rvm-auto.sh as deploy@ilf-web1
INFO [d6490632] Finished in 0.196 seconds with exit status 0 (successful).
** Invoke db:pull (first_time)
** Invoke db:local:sync (first_time)
** Execute db:local:sync
cap aborted!
NameError: uninitialized constant Rails
(erb):4:in `<main>'
/Users/andrew/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/erb.rb:864:in `eval'
/Users/andrew/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/erb.rb:864:in `result'
/Users/andrew/.rvm/gems/ruby-2.3.0/gems/capistrano-db-tasks-0.4/lib/capistrano-db-tasks/database.rb:114:in `initialize'
/Users/andrew/.rvm/gems/ruby-2.3.0/gems/capistrano-db-tasks-0.4/lib/capistrano-db-tasks/dbtasks.rb:35:in `new'
/Users/andrew/.rvm/gems/ruby-2.3.0/gems/capistrano-db-tasks-0.4/lib/capistrano-db-tasks/dbtasks.rb:35:in `block (4 levels) in <top (required)>'
/Users/andrew/.rvm/gems/ruby-2.3.0/gems/sshkit-1.8.1/lib/sshkit/backends/abstract.rb:15:in `instance_exec'
/Users/andrew/.rvm/gems/ruby-2.3.0/gems/sshkit-1.8.1/lib/sshkit/backends/abstract.rb:15:in `run'
/Users/andrew/.rvm/gems/ruby-2.3.0/gems/sshkit-1.8.1/lib/sshkit/runners/parallel.rb:13:in `block (2 levels) in execute'
Tasks: TOP => db:pull => db:local:sync
from capistrano-db-tasks.
Never mind. My fault.
from capistrano-db-tasks.
@kiddrew what was your issue? I apparently am doing the same thing by triggering the same error but am not seeing anything wrong.
from capistrano-db-tasks.
@kiddrew thanks for the reply! I found a similar line almost exactly the same time as I saw this response after doing some debugging on my own fork. This thread may help some other poor developer down the road who doesn't realize that this error means they were using Rails
in their config/database.yml
. It would be nice if this common pattern (parsing a YML as ERB first) didn't require having the developer confuse the interpreter as to the context of where the error is happening since the flow is file
-> string
-> ERB parse
->string
->YML parse
and instead could give the user a nicely formatted error message telling them the error was in the .yml.erb
file, not the unidentified "string" that came from parsing the file
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
- DB:pull 127 error HOT 10
- 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.