GithubHelp home page GithubHelp logo

Comments (5)

kiddrew avatar kiddrew commented on July 23, 2024 1

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.

kiddrew avatar kiddrew commented on July 23, 2024

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.

kiddrew avatar kiddrew commented on July 23, 2024

Never mind. My fault.

from capistrano-db-tasks.

streetlogics avatar streetlogics commented on July 23, 2024

@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.

streetlogics avatar streetlogics commented on July 23, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.