Ubuntu rake 中止! NameError:未初始化的常量 ActionDispatch::XmlParamsParser

Posted

技术标签:

【中文标题】Ubuntu rake 中止! NameError:未初始化的常量 ActionDispatch::XmlParamsParser【英文标题】:Ubuntu rake aborted! NameError: uninitialized constant ActionDispatch::XmlParamsParser 【发布时间】:2017-12-18 03:23:20 【问题描述】:

我正在尝试在具有 16.04 ubuntu 的机器上安装 redmine 的插件。现在我正在尝试安装敏捷插件。我收到了有关如何安装插件的官方文档。我按照一步一步的安装,我遇到了一个错误。

重要:

我使用的是 Ruby 2.3.1。

步骤

    在插件文件夹中下载并解压 cd /var/www/redminebundle install --without development test --no-deployment (由于 mysql、nokogiri 和其他 gem,我在这里遇到了一些错误。但现在一切正常) bundle exec rake redmine:plugins NAME=redmine_agile RAILS_ENV=production

但是每次我执行上一条命令时都会收到这个错误:

(在 /usr/share/redmine 中)rake 中止! NameError: 未初始化 常量 ActionDispatch::XmlParamsParser 你的意思是? ActionDispatch::ParamsParser

这是完整的日志:(带有跟踪)

在 /usr/share/redmine) rake 中止! NameError:未初始化的常量 ActionDispatch::XmlParamsParser 你的意思是? ActionDispatch::ParamsParser /usr/share/redmine/config/application.rb:55:in <class:Application>' /usr/share/redmine/config/application.rb:8:in' /usr/share/redmine/config/application.rb:7:in <top (required)>' /usr/share/redmine/Rakefile:4:inrequire' /usr/share/redmine/Rakefile:4:in <top (required)>' /var/lib/gems/2.3.0/gems/rake-12.0.0/lib/rake/rake_module.rb:28:in load' /var/lib/gems/2.3.0/gems/rake-12.0.0/lib/rake/rake_module.rb:28:in load_rakefile' /var/lib/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:687:in raw_load_rakefile' /var/lib/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:96:in block in load_rakefile' /var/lib/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:178:in standard_exception_handling' /var/lib/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:95:in load_rakefile' /var/lib/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:79:in block 正在运行' /var/lib/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:178:in standard_exception_handling' /var/lib/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:77:in run' /var/lib/gems/2.3.0/gems/rake-12.0.0/exe/rake:27:in <top (required)>' /usr/local/bin/rake:23:inload' /usr/local/bin/rake:23:in <top (required)>' /var/lib/gems/2.3.0/gems/bundler-1.15.1/lib/bundler/cli/exec.rb:74:in load' /var/lib/gems/2.3.0/gems/bundler-1.15.1/lib/bundler/cli/exec.rb:74:in kernel_load' /var/lib/gems/2.3.0/gems/bundler-1.15.1/lib/bundler/cli/exec.rb:27:in run' /var/lib/gems/2.3.0/gems/bundler-1.15.1/lib/bundler/cli.rb:360:in exec' /var/lib/gems/2.3.0/gems/bundler-1.15.1/lib/bundler/vendor/thor/lib/thor/command.rb:27:in run' /var/lib/gems/2.3.0/gems/bundler-1.15.1/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in invoke_command' /var/lib/gems/2.3.0/gems/bundler-1.15.1/lib/bundler/vendor/thor/lib/thor.rb:369:in dispatch' /var/lib/gems/2.3.0/gems/bundler-1.15.1/lib/bundler/cli.rb:20:in dispatch' /var/lib/gems/2.3.0/gems/bundler-1.15.1/lib/bundler/vendor/thor/lib/thor/base.rb:444:in start' /var/lib/gems/2.3.0/gems/bundler-1.15.1/lib/bundler/cli.rb:10:in start' /var/lib/gems/2.3.0/gems/bundler-1.15.1/exe/bundle:35:in block in ' /var/lib/gems/2.3.0/gems/bundler-1.15.1/lib/bundler/friendly_errors.rb:121:in with_friendly_errors' /var/lib/gems/2.3.0/gems/bundler-1.15.1/exe/bundle:27:in' /usr/local/bin/bundle:23:in load' /usr/local/bin/bundle:23:in'

我看到了其他帖子,我已经尝试过:

    更改版本:我有最后一个 redmine 版本

    gem install actionpack-xml_parser

    更新捆绑器

    在 redmine root 上执行 rake(我在 /var/www/html/redmine 上执行此操作

    我在 redmine 仪表板上看到了一些修复此错误的帖子。它是 2015 年的。我希望现在有一些修复

结构

我在 /var/www/html/redmine 上安装了 redmine,在 /var/www/html/redmine/plugins 上安装了我的插件。我在 /var/www/html/redmine 上执行我的命令。

如果有必要,这里是我的宝石清单:

*** LOCAL GEMS ***

actionmailer (5.1.2, 4.2.9, 4.2.6)
actionpack (5.1.2, 4.2.9, 4.2.6)
actionpack-action_caching (1.2.0, 1.1.1)
actionpack-xml_parser (2.0.1, 1.0.2)
actionview (5.1.2, 4.2.9, 4.2.6)
activejob (5.1.2, 4.2.9, 4.2.6)
activemodel (5.1.2, 4.2.9, 4.2.6)
activerecord (5.1.2, 4.2.9, 4.2.6)
activesupport (5.1.2, 4.2.9, 4.2.6)
addressable (2.5.1, 2.3.8)
arel (8.0.0, 6.0.4, 6.0.3)
atomic (1.1.16)
awesome_nested_set (3.1.3, 3.0.0)
bigdecimal (1.2.8)
binding_of_caller (0.7.2)
blankslate (3.1.3)
builder (3.2.3, 3.2.2)
bundler (1.15.1, 1.11.2)
byebug (5.0.0)
coderay (1.1.1)
coffee-rails (4.2.2, 4.1.0)
coffee-script (2.4.1)
coffee-script-source (1.12.2, 1.9.1.1)
colored (1.2)
columnize (0.9.0)
concurrent-ruby (1.0.5)
connection_pool (2.2.1)
css_parser (1.5.0, 1.3.6)
debug_inspector (0.0.2)
did_you_mean (1.0.0)
erubi (1.6.1)
erubis (2.7.0)
eventmachine (1.0.7)
execjs (2.7.0, 2.6.0)
ffi (1.9.10)
gemrat (0.4.6)
globalid (0.4.0, 0.3.6)
hike (2.1.3, 1.2.1)
htmlentities (4.3.4, 4.3.3)
i18n (0.8.6, 0.7.0)
io-console (0.4.5)
jbuilder (2.7.0, 2.3.1)
jquery-rails (4.3.1, 4.0.5)
json (1.8.3)
listen (3.1.5, 3.0.3)
loofah (2.0.3)
mail (2.6.6, 2.6.3)
method_source (0.8.2)
mime-types (3.1, 2.6.1)
mime-types-data (3.2016.0521)
mini_portile2 (2.2.0)
minitest (5.10.2, 5.8.4)
molinillo (0.5.7, 0.4.3)
multi_json (1.12.1, 1.11.2)
mysql2 (0.4.8, 0.4.3)
net-http-persistent (3.0.0, 2.9.4)
net-ldap (0.16.0, 0.8.0)
net-telnet (0.1.1)
nokogiri (1.8.0, 1.6.7.2)
oj (2.12.10)
polyglot (0.3.5, 0.3.4)
power_assert (1.0.2, 0.2.7)
protected_attributes (1.1.4, 1.1.3)
psych (2.0.17)
public_suffix (2.0.5)
rack (2.0.3, 1.6.8, 1.6.4)
rack-openid (1.4.2)
rack-test (0.7.0, 0.6.3)
rails (4.2.9, 4.2.6)
rails-deprecated_sanitizer (1.0.3)
rails-dom-testing (2.0.3, 1.0.8, 1.0.6)
rails-html-sanitizer (1.0.3)
rails-observers (0.1.4, 0.1.2)
railties (5.1.2, 4.2.9, 4.2.6)
rake (12.0.0, 10.5.0)
rb-fsevent (0.10.2)
rb-inotify (0.9.10, 0.9.7)
rbpdf (1.19.2, 1.19.0)
rbpdf-font (1.19.1, 1.19.0)
rdoc (5.1.0, 4.2.1)
redcarpet (3.4.0, 3.3.4)
request_store (1.3.2, 1.3.0)
rmagick (2.16.0, 2.15.4)
roadie (3.2.2, 3.1.1)
roadie-rails (1.2.1, 1.1.0)
ruby-hmac (0.4.0)
ruby-openid (2.7.0)
ruby_dep (1.5.0)
sass (3.4.25, 3.4.21)
sass-rails (5.0.6, 5.0.4)
sdoc (0.4.2, 0.4.1)
spring (2.0.2, 1.3.6)
sprockets (3.7.1, 3.3.0)
sprockets-rails (3.2.0, 2.3.2)
sqlite3 (1.3.11)
test-unit (3.2.5, 3.1.7)
thor (0.19.4, 0.19.1)
thread_safe (0.3.6, 0.3.5)
tilt (2.0.7, 2.0.1)
treetop (1.6.8, 1.6.3)
turbolinks (5.0.1, 2.5.3)
turbolinks-source (5.0.3)
tzinfo (1.2.3, 1.2.2)
uglifier (3.2.0, 2.7.2)
web-console (2.2.1)

【问题讨论】:

你一开始有没有尝试安装没有插件的redmine? 我在 Debian 9 上遇到了同样的问题。我通过 Debian 官方软件包安装了 redmine。 【参考方案1】:

我尝试从 /usr/share/redmine 而不是插件目录执行相同的命令,它对我有用。在我遇到同样的问题之前。

这是在GitHub issue 中推荐的。

【讨论】:

以上是关于Ubuntu rake 中止! NameError:未初始化的常量 ActionDispatch::XmlParamsParser的主要内容,如果未能解决你的问题,请参考以下文章

rake 路由 rake 中止! ArgumentError:必须使用路径和/或选项调用

Rails 4 - AwesomeEotPath 之后 Rake 中止,无效的 CSS

rake 中止的数据库将不会迁移

Rails 3.1.1 资产预编译 - rake 中止

Rake 正在中止,因为 sqlite db 的未定义方法“inet”

heroku 运行 rake 资产:预编译中止,因为文件具有无效的 UTF-8 字节序列