简体   繁体   中英

Secret generation in Redmine installation fails with error in json

I am trying to install redmine-3.4.2 on CentOS Linux release 7.3.1611 (Core)

  1. Downloaded and extracted redmine-3.4.2 created database.yml & configuration.yml
  2. Installed ruby & dependence using

    yum install -y gcc-c++ rubygems ruby-devel ImageMagick-devel ImageMagick

  3. Then done successfully completed gem install bundler and bundle install --without development test

  4. Finally getting error while running bundle exec rake generate_secret_token with RAILS_ENV=production REDMINE_LANG=en

My Ruby gem version as follows:-

Ruby : ruby 2.0.0p648 (2015-12-16) [x86_64-linux]
Gem : 2.0.14.1
Rails : Rails 4.2.8

bundle exec rake generate_secret_token --trace
rake aborted!
LoadError: cannot load such file -- json
/usr/local/share/gems/gems/activesupport-4.2.8/lib/active_support/core_ext/object/json.rb:2:in 'require'
/usr/local/share/gems/gems/activesupport-4.2.8/lib/active_support/core_ext/object/json.rb:2:in '<top (required)>'
/usr/local/share/gems/gems/activesupport-4.2.8/lib/active_support/core_ext/object.rb:12:in `require'
/usr/local/share/gems/gems/activesupport-4.2.8/lib/active_support/core_ext/object.rb:12:in `<top (required)>'
/usr/local/share/gems/gems/railties-4.2.8/lib/rails/configuration.rb:2:in `require'
/usr/local/share/gems/gems/railties-4.2.8/lib/rails/configuration.rb:2:in `<top (required)>'
/usr/local/share/gems/gems/railties-4.2.8/lib/rails/railtie.rb:2:in `require'
/usr/local/share/gems/gems/railties-4.2.8/lib/rails/railtie.rb:2:in `<top (required)>'
/usr/local/share/gems/gems/railties-4.2.8/lib/rails/engine.rb:1:in `require'
/usr/local/share/gems/gems/railties-4.2.8/lib/rails/engine.rb:1:in `<top (required)>'
/usr/local/share/gems/gems/railties-4.2.8/lib/rails/application.rb:7:in `require'
/usr/local/share/gems/gems/railties-4.2.8/lib/rails/application.rb:7:in `<top (required)>'
/usr/local/share/gems/gems/railties-4.2.8/lib/rails.rb:11:in `require'
/usr/local/share/gems/gems/railties-4.2.8/lib/rails.rb:11:in `<top (required)>'
/usr/local/share/gems/gems/railties-4.2.8/lib/rails/all.rb:1:in `require'
/usr/local/share/gems/gems/railties-4.2.8/lib/rails/all.rb:1:in `<top (required)>'
/opt/APPS/redmine-3.4.2/config/application.rb:3:in `require'
/opt/APPS/redmine-3.4.2/config/application.rb:3:in `<top (required)>'
/opt/APPS/redmine-3.4.2/Rakefile:5:in `require'
/opt/APPS/redmine-3.4.2/Rakefile:5:in `<top (required)>'
/usr/local/share/gems/gems/rake-12.0.0/lib/rake/rake_module.rb:28:in `load'
/usr/local/share/gems/gems/rake-12.0.0/lib/rake/rake_module.rb:28:in `load_rakefile'
/usr/local/share/gems/gems/rake-12.0.0/lib/rake/application.rb:687:in `raw_load_rakefile'
/usr/local/share/gems/gems/rake-12.0.0/lib/rake/application.rb:96:in `block in load_rakefile'
/usr/local/share/gems/gems/rake-12.0.0/lib/rake/application.rb:178:in `standard_exception_handling'
/usr/local/share/gems/gems/rake-12.0.0/lib/rake/application.rb:95:in `load_rakefile'
/usr/local/share/gems/gems/rake-12.0.0/lib/rake/application.rb:79:in `block in run'
/usr/local/share/gems/gems/rake-12.0.0/lib/rake/application.rb:178:in `standard_exception_handling'
/usr/local/share/gems/gems/rake-12.0.0/lib/rake/application.rb:77:in `run'
/usr/local/share/gems/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
/usr/local/bin/rake:23:in `load'
/usr/local/bin/rake:23:in `<top (required)>'
/usr/local/share/gems/gems/bundler-1.15.4/lib/bundler/cli/exec.rb:74:in `load'
/usr/local/share/gems/gems/bundler-1.15.4/lib/bundler/cli/exec.rb:74:in `kernel_load'
/usr/local/share/gems/gems/bundler-1.15.4/lib/bundler/cli/exec.rb:27:in `run'
/usr/local/share/gems/gems/bundler-1.15.4/lib/bundler/cli.rb:362:in `exec'
/usr/local/share/gems/gems/bundler-1.15.4/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/usr/local/share/gems/gems/bundler-1.15.4/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/usr/local/share/gems/gems/bundler-1.15.4/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
/usr/local/share/gems/gems/bundler-1.15.4/lib/bundler/cli.rb:22:in `dispatch'
/usr/local/share/gems/gems/bundler-1.15.4/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
/usr/local/share/gems/gems/bundler-1.15.4/lib/bundler/cli.rb:13:in `start'
/usr/local/share/gems/gems/bundler-1.15.4/exe/bundle:30:in `block in <top (required)>'
/usr/local/share/gems/gems/bundler-1.15.4/lib/bundler/friendly_errors.rb:121:in `with_friendly_errors'
/usr/local/share/gems/gems/bundler-1.15.4/exe/bundle:22:in `<top (required)>'
/usr/local/bin/bundle:23:in `load'
/usr/local/bin/bundle:23:in `<main>'

Thanks in Advance

Resolved by adding a Gemfile.local inside redmine directory

# Gemfile.local
gem 'multi_json'
gem 'json'

then run bundle lock --add-platform x86_64-linux (get your platform from ruby -v ) followed by bundle install --without development test

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM