无法使用foreman-rake重置领班管理员密码

时间:2016-09-28 14:54:07

标签: mysql ruby-on-rails ruby rake foreman

我正在尝试将数据库从sqlite迁移到mysql。使用foreman-mysql2成功迁移数据库。重新启动工头后,我无法使用admin / changeme登录。

然后我尝试使用以下命令重置密码

foreman-rake permission-reset password=secret

但我收到以下错误

rake aborted!

不知道如何建立任务'权限:重置' (见--tasks) /usr/share/foreman/vendor/ruby/1.9.1/gems/rake-10.5.0/lib/rake/task_manager.rb:62:in []' /usr/share/foreman/vendor/ruby/1.9.1/gems/rake-10.5.0/lib/rake/application.rb:149:in invoke_task' /usr/share/foreman/vendor/ruby/1.9.1/gems/rake-10.5.0/lib/rake/application.rb:106:in block (2 levels) in top_level' /usr/share/foreman/vendor/ruby/1.9.1/gems/rake-10.5.0/lib/rake/application.rb:106:in每个' /usr/share/foreman/vendor/ruby/1.9.1/gems/rake-10.5.0/lib/rake/application.rb:106:in block in top_level' /usr/share/foreman/vendor/ruby/1.9.1/gems/rake-10.5.0/lib/rake/application.rb:115:in run_with_threads' /usr/share/foreman/vendor/ruby/1.9.1/gems/rake-10.5.0/lib/rake/application.rb:100:in top_level' /usr/share/foreman/vendor/ruby/1.9.1/gems/rake-10.5.0/lib/rake/application.rb:78:in阻止运行' /usr/share/foreman/vendor/ruby/1.9.1/gems/rake-10.5.0/lib/rake/application.rb:176:in standard_exception_handling' /usr/share/foreman/vendor/ruby/1.9.1/gems/rake-10.5.0/lib/rake/application.rb:75:in run' /usr/bin/rake1.9.1:32:in`'

1 个答案:

答案 0 :(得分:0)

我正在为自己的问题发布答案

不允许.... 其权限

当我们收到这样的错误时,只需在命令末尾输入--tasks并查看rake list,确保您正在尝试的那个存在于该列表中..,

正确的命令:

sudo foreman-rake permissions:reset PASSWORD=secret

在运行上述命令时,可能会出现另一个错误

ERF42-7495
"Cannot find user foreman_admin when switching context" or "Cannot find user foreman_api_admin when switching context"

要解决此问题,只需输入以下命令

即可
foreman-rake db:seed