Redmine安装Apache2 Bundler PermissionError

时间:2016-02-05 14:50:42

标签: ruby apache apache2 passenger redmine

我正在尝试使用此tutorial安装Redmine: 我不熟悉Ruby。每当我在浏览器中转到http://localhost/redminehttp://localhost/redmine/settings?tab=general时,我会看到一个包含以下消息的页面:

  

我们很抱歉,但出了点问题。

     

我们已收到有关此问题的通知,我们将对此进行审核   不久。

所以我决定查看我的apache2错误日志:sudo nano /var/log/apache2/error.log

我找到了以下消息,将Bundler文件夹的权限更改为每个人,然后重新启动Apache。但是这没有帮助我仍然在浏览器中收到相同的消息。我做错了什么?

使用Ubuntu 14.05

/var/log/apache2/error.log

[ 2016-02-05 15:26:39.0461 24027/7fca480e5700 age/Cor/App/Implementation.cpp:304 ]: Could not spawn process for application /usr/share/redmine: An error occurred while starting up the preloader.
  Error ID: d4625db4
  Error details saved to: /tmp/passenger-error-yGu5Vm.html
  Message from application: Bundler::PermissionError (Bundler::PermissionError)
  /var/lib/gems/2.1.0/gems/bundler-1.11.2/lib/bundler/shared_helpers.rb:116:in `rescue in filesystem_access'
  /var/lib/gems/2.1.0/gems/bundler-1.11.2/lib/bundler/shared_helpers.rb:114:in `filesystem_access'
  /var/lib/gems/2.1.0/gems/bundler-1.11.2/lib/bundler/definition.rb:267:in `lock'
  /var/lib/gems/2.1.0/gems/bundler-1.11.2/lib/bundler/environment.rb:34:in `lock'
  /var/lib/gems/2.1.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:44:in `setup'
  /var/lib/gems/2.1.0/gems/bundler-1.11.2/lib/bundler.rb:92:in `setup'
  /var/lib/gems/2.1.0/gems/bundler-1.11.2/lib/bundler/setup.rb:18:in `<top (required)>'
  /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
  /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:430:in `activate_gem'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:297:in `block in run_load_path_setup_code'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:435:in `running_bundler'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:296:in `run_load_path_setup_code'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:100:in `preload_app'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:156:in `<module:App>'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:30:in `<module:PhusionPassenger>'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:29:in `<main>'


[ 2016-02-05 15:26:39.0552 24027/7fca4aaee700 age/Cor/Con/CheckoutSession.cpp:277 ]: [Client 2-1] Cannot checkout session because a spawning error occurred. The identifier of the error is d4625db4. Please see earlier logs for details about the error.

在/tmp/passenger-error-yGu5Vm.html中:

Bundler::PermissionError (Bundler::PermissionError)
  /opt/redmine/.rvm/gems/ruby-2.1.4/gems/bundler-1.11.2/lib/bundler/shared_helpers.rb:116:in `rescue in filesystem_access'
  /opt/redmine/.rvm/gems/ruby-2.1.4/gems/bundler-1.11.2/lib/bundler/shared_helpers.rb:114:in `filesystem_access'
  /opt/redmine/.rvm/gems/ruby-2.1.4/gems/bundler-1.11.2/lib/bundler/definition.rb:267:in `lock'
  /opt/redmine/.rvm/gems/ruby-2.1.4/gems/bundler-1.11.2/lib/bundler/environment.rb:34:in `lock'
  /opt/redmine/.rvm/gems/ruby-2.1.4/gems/bundler-1.11.2/lib/bundler/runtime.rb:44:in `setup'
  /opt/redmine/.rvm/gems/ruby-2.1.4/gems/bundler-1.11.2/lib/bundler.rb:92:in `setup'
  /opt/redmine/.rvm/gems/ruby-2.1.4/gems/bundler-1.11.2/lib/bundler/setup.rb:18:in `<top (required)>'
  /opt/redmine/.rvm/rubies/ruby-2.1.4/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
  /opt/redmine/.rvm/rubies/ruby-2.1.4/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:430:in `activate_gem'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:297:in `block in run_load_path_setup_code'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:435:in `running_bundler'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:296:in `run_load_path_setup_code'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:100:in `preload_app'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:156:in `<module:App>'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:30:in `<module:PhusionPassenger>'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:29:in `<main>'

Error ID
    5d410186
Application root
    /usr/share/redmine
Environment (value of RAILS_ENV, RACK_ENV, WSGI_ENV, NODE_ENV and PASSENGER_APP_ENV)
    production
Ruby interpreter command

    /usr/bin/passenger_free_ruby

User and groups

    uid=119(redmine) gid=128(redmine) groups=128(redmine)

Environment variables

    APACHE_PID_FILE = /var/run/apache2/apache2.pid
    rvm_bin_path = /opt/redmine/.rvm/bin
    GEM_HOME = /opt/redmine/.rvm/gems/ruby-2.1.4
    SHELL = /bin/bash
    APACHE_RUN_USER = www-data
    IRBRC = /opt/redmine/.rvm/rubies/ruby-2.1.4/.irbrc
    PASSENGER_DEBUG_DIR = /tmp/passenger.spawn-debug.XXXXVrAXrr
    MY_RUBY_HOME = /opt/redmine/.rvm/rubies/ruby-2.1.4
    rvm_stored_umask = 0022
    USER = redmine
    _system_type = Linux
    rvm_path = /opt/redmine/.rvm
    PASSENGER_USE_FEEDBACK_FD = true
    rvm_prefix = /opt/redmine
    APACHE_LOG_DIR = /var/log/apache2
    PATH = /opt/redmine/.rvm/gems/ruby-2.1.4/bin:/opt/redmine/.rvm/gems/ruby-2.1.4@global/bin:/opt/redmine/.rvm/rubies/ruby-2.1.4/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/redmine/.rvm/bin
    QT_QPA_PLATFORMTHEME = appmenu-qt5
    rvm_loaded_flag = 1
    PWD = /usr/share/redmine
    APACHE_RUN_GROUP = www-data
    LANG = C
    _system_arch = x86_64
    _system_version = 14.04
    rvm_version = 1.26.11 (latest)
    SHLVL = 0
    HOME = /opt/redmine
    LOGNAME = redmine
    SERVER_SOFTWARE = Apache/2.4.7 (Ubuntu) SVN/1.8.8 Phusion_Passenger/5.0.24
    GEM_PATH = /opt/redmine/.rvm/gems/ruby-2.1.4:/opt/redmine/.rvm/gems/ruby-2.1.4@global
    APACHE_LOCK_DIR = /var/lock/apache2
    APACHE_RUN_DIR = /var/run/apache2
    RUBY_VERSION = ruby-2.1.4
    rvm_user_install_flag = 1
    _system_name = Ubuntu
    IN_PASSENGER = 1
    PYTHONUNBUFFERED = 1
    NODE_PATH = /usr/share/passenger/node
    RAILS_ENV = production
    RACK_ENV = production
    WSGI_ENV = production
    NODE_ENV = production
    PASSENGER_APP_ENV = production
    RAILS_RELATIVE_URL_ROOT = /redmine
    RACK_BASE_URI = /redmine
    PASSENGER_BASE_URI = /redmine
    _ORIGINAL_GEM_PATH = /opt/redmine/.rvm/gems/ruby-2.1.4:/opt/redmine/.rvm/gems/ruby-2.1.4@global
    BUNDLE_BIN_PATH = /opt/redmine/.rvm/gems/ruby-2.1.4/gems/bundler-1.11.2/exe/bundle
    BUNDLE_GEMFILE = /usr/share/redmine/Gemfile
    RUBYOPT = -rbundler/setup
    RUBYLIB = /opt/redmine/.rvm/gems/ruby-2.1.4/gems/bundler-1.11.2/lib

1 个答案:

答案 0 :(得分:1)

FinkAvenue:当ruby的gems路径没有适当的权限时会发生这种情况。在这种情况下,请确保/opt/redmine/.rvm/gems/ruby-2.1.4/gems具有适当的权限。运行Bundler的用户无权访问目录/opt/redmine/.rvm/gems/ruby-2.1.4/gems