Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rake aborted! database configuration does not specify adapter #29

Open
JoshuaWohle opened this issue Sep 16, 2012 · 9 comments
Open

rake aborted! database configuration does not specify adapter #29

JoshuaWohle opened this issue Sep 16, 2012 · 9 comments

Comments

@JoshuaWohle
Copy link

I have used your plugin for a while on a redmine 1.4.x instance and it was working perfectly fine. Today I upgraded to redmine 2.0.3 and re-installed your plugin. However, for some reason I cannot get it to work.

I am trying out the cron command (to check it's validity) like this :

rake redmine:send_digest start=1 days=1 Rails.env="production"

I tried many variants like

rake redmine:send_digest start=1 days=1 RAILS_ENV="production"
rake redmine:send_digest start=1 days=1 Rails.env=production
rake redmine:send_digest start=1 days=1 RAILS_ENV=production

but I always get the follwoing error :

rake aborted!
database configuration does not specify adapter
/var/lib/gems/1.9.1/gems/activerecord-3.2.6/lib/active_record/connection_adapters/abstract/connection_specification.rb:45:in resolve_hash_connection' /var/lib/gems/1.9.1/gems/activerecord-3.2.6/lib/active_record/connection_adapters/abstract/connection_specification.rb:39:inresolve_string_connection'
/var/lib/gems/1.9.1/gems/activerecord-3.2.6/lib/active_record/connection_adapters/abstract/connection_specification.rb:23:in spec' /var/lib/gems/1.9.1/gems/activerecord-3.2.6/lib/active_record/connection_adapters/abstract/connection_specification.rb:127:inestablish_connection'
/var/lib/gems/1.9.1/gems/activerecord-3.2.6/lib/active_record/railtie.rb:82:in block (2 levels) in <class:Railtie>' /var/lib/gems/1.9.1/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:36:ininstance_eval'
/var/lib/gems/1.9.1/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:36:in execute_hook' /var/lib/gems/1.9.1/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:43:inblock in run_load_hooks'
/var/lib/gems/1.9.1/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:42:in each' /var/lib/gems/1.9.1/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:42:inrun_load_hooks'
/var/lib/gems/1.9.1/gems/activerecord-3.2.6/lib/active_record/base.rb:721:in <top (required)>' /usr/share/redmine/lib/plugins/acts_as_activity_provider/init.rb:2:inblock in <top (required)>'
/usr/share/redmine/config/initializers/00-core_plugins.rb:12:in eval' /usr/share/redmine/config/initializers/00-core_plugins.rb:12:inblock in <top (required)>'
/usr/share/redmine/config/initializers/00-core_plugins.rb:2:in each' /usr/share/redmine/config/initializers/00-core_plugins.rb:2:in<top (required)>'
/var/lib/gems/1.9.1/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:245:in load' /var/lib/gems/1.9.1/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:245:inblock in load'
/var/lib/gems/1.9.1/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:236:in load_dependency' /var/lib/gems/1.9.1/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:245:inload'
/var/lib/gems/1.9.1/gems/railties-3.2.6/lib/rails/engine.rb:588:in block (2 levels) in <class:Engine>' /var/lib/gems/1.9.1/gems/railties-3.2.6/lib/rails/engine.rb:587:ineach'
/var/lib/gems/1.9.1/gems/railties-3.2.6/lib/rails/engine.rb:587:in block in <class:Engine>' /var/lib/gems/1.9.1/gems/railties-3.2.6/lib/rails/initializable.rb:30:ininstance_exec'
/var/lib/gems/1.9.1/gems/railties-3.2.6/lib/rails/initializable.rb:30:in run' /var/lib/gems/1.9.1/gems/railties-3.2.6/lib/rails/initializable.rb:55:inblock in run_initializers'
/var/lib/gems/1.9.1/gems/railties-3.2.6/lib/rails/initializable.rb:54:in each' /var/lib/gems/1.9.1/gems/railties-3.2.6/lib/rails/initializable.rb:54:inrun_initializers'
/var/lib/gems/1.9.1/gems/railties-3.2.6/lib/rails/application.rb:136:in initialize!' /var/lib/gems/1.9.1/gems/railties-3.2.6/lib/rails/railtie/configurable.rb:30:inmethod_missing'
/usr/share/redmine/config/environment.rb:14:in <top (required)>' /usr/share/redmine/plugins/redmine_digest/lib/tasks/digest.rake:32:inrequire'
/usr/share/redmine/plugins/redmine_digest/lib/tasks/digest.rake:32:in <top (required)>' /usr/share/redmine/lib/tasks/redmine.rake:89:inload'
/usr/share/redmine/lib/tasks/redmine.rake:89:in block in <top (required)>' /usr/share/redmine/lib/tasks/redmine.rake:89:ineach'
/usr/share/redmine/lib/tasks/redmine.rake:89:in <top (required)>' /var/lib/gems/1.9.1/gems/railties-3.2.6/lib/rails/engine.rb:425:inload'
/var/lib/gems/1.9.1/gems/railties-3.2.6/lib/rails/engine.rb:425:in block in load_tasks' /var/lib/gems/1.9.1/gems/railties-3.2.6/lib/rails/engine.rb:425:ineach'
/var/lib/gems/1.9.1/gems/railties-3.2.6/lib/rails/engine.rb:425:in load_tasks' /var/lib/gems/1.9.1/gems/railties-3.2.6/lib/rails/application.rb:145:inload_tasks'
/var/lib/gems/1.9.1/gems/railties-3.2.6/lib/rails/railtie/configurable.rb:30:in method_missing' /usr/share/redmine/Rakefile:7:in<top (required)>'
/var/lib/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/rake_module.rb:25:in load' /var/lib/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/rake_module.rb:25:inload_rakefile'
/var/lib/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:501:in raw_load_rakefile' /var/lib/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:82:inblock in load_rakefile'
/var/lib/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in standard_exception_handling' /var/lib/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:81:inload_rakefile'
/var/lib/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:65:in block in run' /var/lib/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:instandard_exception_handling'
/var/lib/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:63:in run' /var/lib/gems/1.9.1/gems/rake-0.9.2.2/bin/rake:33:in<top (required)>'
/usr/local/bin/rake:23:in load' /usr/local/bin/rake:23:in

'

I hope you can help me with this :)

@drewkeller
Copy link
Owner

database configuration does not specify adapter

Sounds like you need to specify the adapter for your database? Also make sure your configuration is correct for the database username, etc. I don't think this error is related to the plugin. Is Redmine able to run its production environment without the plugin installed?

I'm assuming you updated the plugin when you updated Redmine. The old version is not compatible with the new version of Redmine.

@JoshuaWohle
Copy link
Author

Redmine is running fine (even with the plugin installed) and yes, I installed a completely new version of the digest plugin when I reinstalled redmine.

Any other suggestions ?

@JoshuaWohle
Copy link
Author

In the interest in giving you as much information as possible, here is another try, with RAILS_ENV set instead of Rails.env.

/usr/share/redmine$ rake redmine:send_digest start=0 days=1 RAILS_ENV=production --trace
** Invoke redmine:send_digest (first_time)
** Execute redmine:send_digest
rake aborted!
string not matched
/usr/share/redmine/plugins/redmine_digest/lib/tasks/digest.rake:47:in []=' /usr/share/redmine/plugins/redmine_digest/lib/tasks/digest.rake:47:inblock (2 levels) in <top (required)>'
/var/lib/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in call' /var/lib/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:inblock in execute'
/var/lib/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'

@drewkeller
Copy link
Owner

RAILS_ENV is obsolete

Did you perform the database migration? I have forgotten that step before myself.

@JoshuaWohle
Copy link
Author

I did yeah and it completes succesfully. However, I have managed to find a small workaround. I commented out line 47 of digest.rake and now things go through. However, I have to use something like "rake redmine:send_digest start=0 days=1 RAILS_ENV="production" environment="production". The digest now gets sent though :)

@JoshuaWohle
Copy link
Author

I was being happy too early... It gets sent, but doesn't take into account the parameters, meaning it only sends the digest of the day :(. Could you please help me out with this ? I really do want it to work :(. What can I provide you with to get this sorted ?

@JoshuaWohle
Copy link
Author

If anyone else is having this problem, I finally figured it out. By commenting out the line I said before (line 47 of the digest.rake), the system was not taking into account my preferences through the command-line anymore. All I had to do is change them in my redmine admin (plugin configurations) and then simply run redmine:send_digest RAILS_ENV=production and everything went through fine.

However, I would still consider this a bug somewhere, as i do not think I was supposed to go around it like this.

@drewkeller
Copy link
Owner

Glad you got it working. That function is supposed to read the variables
from the rake command and set them for the main part of the plugin, but
I guess it isn't working now.

On 9/26/2012 3:34 AM, Joshua Wöhle wrote:

If anyone else is having this problem, I finally figured it out. By
commenting out the line I said before (line 47 of the digest.rake),
the system was not taking into account my preferences through the
command-line anymore. All I had to do is change them in my redmine
admin (plugin configurations) and then simply run redmine:send_digest
RAILS_ENV=production and everything went through fine.

However, I would still consider this a bug somewhere, as i do not
think I was supposed to go around it like this.


Reply to this email directly or view it on GitHub
#29 (comment).

@matejak
Copy link

matejak commented Jun 12, 2013

I had the exactly same problem as JW described and I have got over it the same way as him.
Thank you very much!

jackqq added a commit to jackqq/redmine_digest that referenced this issue May 2, 2015
Rails.env merely wraps ENV["RAILS_ENV"]. ENV and Rails.env are not
equivalent.

ref.
http://stackoverflow.com/a/2715076
http://api.rubyonrails.org/classes/Rails.html#method-c-env
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants