Redmine 2.4.4 - 无法启动 Web 应用程序
Posted
技术标签:
【中文标题】Redmine 2.4.4 - 无法启动 Web 应用程序【英文标题】:Redmine 2.4.4 - Web application could not be started 【发布时间】:2014-10-11 07:15:35 【问题描述】:我在 RHEL 6 上运行 Redmine 版本 2.4.4。它运行良好,但是今天早上我检查它时,确实发生了错误。
无法启动 Web 应用程序 无法加载此类文件 -- 捆绑器/设置 (LoadError) /usr/local/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require' /usr/local/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require' /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.38/lib/phusion_passenger/loader_shared_helpers.rb:245:in `block in run_load_path_setup_code' /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.38/lib/phusion_passenger/loader_shared_helpers.rb:348:in `running_bundler' /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.38/lib/phusion_passenger/loader_shared_helpers.rb:243:in `run_load_path_setup_code' /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.38/helper-scripts/rack-preloader.rb:100:in `preload_app' /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.38/helper-scripts/rack-preloader.rb:158:in `' /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.38/helper-scripts/rack-preloader.rb:29:in `' /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.38/helper-scripts/rack-preloader.rb:28:in `' 应用程序根 /选择/redmine/ 环境(RAILS_ENV、RACK_ENV、WSGI_ENV 和 PASSENGER_ENV 的值) 生产 Ruby 解释器命令 /usr/local/bin/ruby 用户和组 uid=48(apache) gid=48(apache) 组=48(apache) 环境变量 期限 = xterm PWD = /opt/redmine 朗= C SHLVL = 2 _ = /usr/sbin/httpd PASSENGER_DEBUG_DIR = /tmp/passenger.spawn-debug.XXXXIokuQq 用户 = 阿帕奇 LOGNAME = 阿帕奇 外壳 = /sbin/nologin 主页 = /var/www IN_PASSENGER = 1 蟒蛇无缓冲 = 1 NODE_PATH = /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.38/node_lib RAILS_ENV = 生产 RACK_ENV = 生产 WSGI_ENV = 生产 NODE_ENV = 生产 PASSENGER_APP_ENV = 生产 RAILS_RELATIVE_URL_ROOT = /redmine RACK_BASE_URI = /redmine PASSENGER_BASE_URI = /redmine HTTPS = 开启 SERVER_PROTOCOL = HTTP/1.1 一般 Ruby 解释器信息 RUBY_VERSION = 1.9.3 RUBY_PLATFORM = x86_64-linux RUBY_ENGINE = 红宝石 RubyGems 版本 = 1.8.23.2 Ruby 配置 (RbConfig::CONFIG) DESTDIR = 专业 = 1 次要 = 9 青少年 = 1 补丁级别 = 547 安装 = /usr/bin/install -c EXEEXT = 前缀 = /usr/local ruby_install_name = 红宝石 RUBY_INSTALL_NAME = 红宝石 RUBY_SO_NAME = 红宝石 执行 = 执行 ruby_pc = ruby-1.9.pc 包装 = 红宝石 BUILTIN_TRANs-s-rCS = newline.c USE_RUBYGEMS = 是 MANTYPE = 文档 NROFF = /usr/bin/nroff vendorhdrdir = /usr/local/include/ruby-1.9.1/vendor_ruby sitehdrdir = /usr/local/include/ruby-1.9.1/site_ruby rubyhdrdir = /usr/local/include/ruby-1.9.1 UNIVERSAL_INTS = UNIVERSAL_ARCHNAMES = 配置参数 = vendordir = /usr/local/lib/ruby/vendor_ruby sitedir = /usr/local/lib/ruby/site_ruby ruby_version = 1.9.1 sitearch = x86_64-linux 拱= x86_64-linux RI_BASE_NAME = ri ridir = /usr/local/share/ri rubylibprefix = /usr/local/lib/ruby MAKEFILES = 生成文件 PLATFORM_DIR = THREAD_MODEL = pthread SYMBOL_PREFIX = EXPORT_PREFIX = COMMON_HEADERS = COMMON_MACROS = COMMON_LIBS = 主库 = ENABLE_SHARED = 否 DLLIBS = -lc 固体= LIBRUBYARG_SHARED = -Wl,-R -Wl,/usr/local/lib -L/usr/local/lib LIBRUBYARG_STATIC = -Wl,-R -Wl,/usr/local/lib -L/usr/local/lib -lruby-static LIBRUBYARG = -Wl,-R -Wl,/usr/local/lib -L/usr/local/lib -lruby-static LIBRUBY = libruby-static.a LIBRUBY_ALIASES = libruby.so LIBRUBY_SO = libruby.so.1.9.1 LIBRUBY_A = libruby-static.a RUBYW_INSTALL_NAME = rubyw_install_name = LIBRUBY_DLDFLAGS = LIBRUBY_LDSHARED = gcc -shared EXTDLDFLAGS = warnflags = -Wall -Wextra -Wno-unused-parameter -Wno-括号 -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration 调试标志 = -ggdb optflags = -O3 cxxflags = -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-括号 -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit -功能声明 cflags = -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-括号 -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit -功能声明 cppflags = NULLCMD = : 安装文档 = 全部 资本目标 = 资本 RDOCTARGET = rdoc EXECUTABLE_EXTS = 存档文件 = LIBRUBY_RELATIVE = 否 EXTOUT = .ext PREP = miniruby TEST_RUNNABLE = 是 设置 = 设置 EXTSTATIC = STRIP = 剥离 -S -x TRY_LINK = LIBPATHENV = LD_LIBRARY_PATH RPATHFLAG = -Wl,-R%1$-s LIBPATHFLAG = -L%1$-s LINK_SO = LIBEXT = 一个 DLEXT2 = DLEXT = 所以 LDSHAREDXX = g++ -shared LDSHARED = gcc -shared CCDLFLAGS = -fPIC 静电= ARCH_FLAG = DLDFLAGS = ALLOCA = 代码设计 = 邮政链接=: WERRORFLAG = -Werror CHDIR = cd -P RMALL = rm -fr RMDIRS = rmdir --ignore-fail-on-non-empty -p RMDIR = rmdir --ignore-fail-on-non-empty CP = cp RM = rm -f PKG_CONFIG = pkg 配置 DOXYGEN = 氧气 点 = MAKEDIRS = /bin/mkdir -p MKDIR_P = /bin/mkdir -p INSTALL_DATA = /usr/bin/install -c -m 644 INSTALL_SCRIPT = /usr/bin/install -c INSTALL_PROGRAM = /usr/bin/install -c SET_MAKE = LN_S = ln -s 纳米 = 纳米 DLLWRAP = 风= 对象复制 = : OBJDUMP = objdump ASFLAGS = AS = 作为 AR = ar RANLIB = 运行库 try_header = COUTFLAG = -o OUTFLAG = -o CPPOUTFILE = -o conftest.i GNU_LD = 是 海湾合作委员会 = 是 EGREP = /bin/grep -E GREP = /bin/grep CPP = gcc -E CXXFLAGS = -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-括号 -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit -功能声明 CXX = g++ 对象 = o CPPFLAGS = LDFLAGS = -L。 -rdynamic -Wl,-export-动态 CFLAGS = -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-括号 -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit -功能声明 CC = gcc 目标操作系统 = linux target_vendor = 未知 target_cpu = x86_64 目标 = x86_64-unknown-linux-gnu host_os = linux-gnu host_vendor = 未知 host_cpu = x86_64 主机 = x86_64-unknown-linux-gnu RUBYW_BASE_NAME = rubyw RUBY_BASE_NAME = 红宝石 build_os = linux-gnu build_vendor = 未知 build_cpu = x86_64 build = x86_64-unknown-linux-gnu RUBY_RELEASE_DATE = 2014-05-14 RUBY_PROGRAM_VERSION = 1.9.3 BASERUBY = 红宝石 目标别名 = 主机别名 = build_alias = LIBS = -lpthread -lrt -ldl -lcrypt -lm ECHO_T = ECHO_N = -n 回声_C = DEFS = mandir = /usr/local/share/man localedir = /usr/local/share/locale libdir = /usr/local/lib psdir = /usr/local/share/doc/ruby pdfdir = /usr/local/share/doc/ruby dvidir = /usr/local/share/doc/ruby htmldir = /usr/local/share/doc/ruby infodir = /usr/local/share/info docdir = /usr/local/share/doc/ruby oldincludedir = /usr/include includeir = /usr/local/include localstatedir = /usr/local/var sharedstatedir = /usr/local/com sysconfdir = /usr/local/etc 数据目录 = /usr/local/share datarootdir = /usr/local/share libexecdir = /usr/local/libexec sbindir = /usr/local/sbin bindir = /usr/local/bin exec_prefix = /usr/local PACKAGE_URL = PACKAGE_BUGREPORT = PACKAGE_STRING = PACKAGE_VERSION = PACKAGE_TARNAME = PACKAGE_NAME = PATH_SEPARATOR =: 外壳 = /bin/sh rubylibdir = /usr/local/lib/ruby/1.9.1 archdir = /usr/local/lib/ruby/1.9.1/x86_64-linux sitelibdir = /usr/local/lib/ruby/site_ruby/1.9.1 sitearchdir = /usr/local/lib/ruby/site_ruby/1.9.1/x86_64-linux vendorlibdir = /usr/local/lib/ruby/vendor_ruby/1.9.1 vendorarchdir = /usr/local/lib/ruby/vendor_ruby/1.9.1/x86_64-linux topdir = /usr/local/lib/ruby/1.9.1/x86_64-linux Ruby 加载路径 ($LOAD_PATH) /usr/local/lib/ruby/site_ruby/1.9.1 /usr/local/lib/ruby/site_ruby/1.9.1/x86_64-linux /usr/local/lib/ruby/site_ruby /usr/local/lib/ruby/vendor_ruby/1.9.1 /usr/local/lib/ruby/vendor_ruby/1.9.1/x86_64-linux /usr/local/lib/ruby/vendor_ruby /usr/local/lib/ruby/1.9.1 /usr/local/lib/ruby/1.9.1/x86_64-linux Ruby 加载的库 ($LOADED_FEATURES) 枚举器.so /usr/local/lib/ruby/1.9.1/x86_64-linux/enc/encdb.so /usr/local/lib/ruby/1.9.1/x86_64-linux/enc/trans/transdb.so /usr/local/lib/ruby/1.9.1/rubygems/defaults.rb /usr/local/lib/ruby/1.9.1/x86_64-linux/rbconfig.rb /usr/local/lib/ruby/1.9.1/rubygems/deprecate.rb /usr/local/lib/ruby/1.9.1/rubygems/exceptions.rb /usr/local/lib/ruby/1.9.1/rubygems/custom_require.rb /usr/local/lib/ruby/1.9.1/rubygems.rb /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.38/lib/phusion_passenger.rb /usr/local/lib/ruby/1.9.1/x86_64-linux/etc.so /usr/local/lib/ruby/1.9.1/fileutils.rb /usr/local/lib/ruby/1.9.1/tmpdir.rb /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.38/lib/phusion_passenger/utils/tmpio.rb /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.38/lib/phusion_passenger/platform_info.rb /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.38/lib/phusion_passenger/platform_info/operating_system.rb /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.38/lib/phusion_passenger/platform_info/ruby.rb /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.38/lib/phusion_passenger/platform_info/binary_compatibility.rb /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.38/buildout/ruby/ruby-1.9.3-x86_64-linux/passenger_native_support.so /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.38/lib/phusion_passenger/native_support.rb /usr/local/lib/ruby/1.9.1/x86_64-linux/socket.so /usr/local/lib/ruby/1.9.1/socket.rb /usr/local/lib/ruby/1.9.1/thread.rb /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.38/lib/phusion_passenger/ruby_core_enhancements.rb /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.38/lib/phusion_passenger/utils/tmpdir.rb /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.38/lib/phusion_passenger/preloader_shared_helpers.rb /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.38/lib/phusion_passenger/constants.rb /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.38/lib/phusion_passenger/public_api.rb /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.38/lib/phusion_passenger/debug_logging.rb /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.38/lib/phusion_passenger/loader_shared_helpers.rb /usr/local/lib/ruby/1.9.1/x86_64-linux/fcntl.so /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.38/lib/phusion_passenger/message_channel.rb /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.38/lib/phusion_passenger/utils.rb /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.38/lib/phusion_passenger/message_client.rb /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.38/lib/phusion_passenger/utils/native_support_utils.rb /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.38/lib/phusion_passenger/utils/unseekable_socket.rb /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.38/lib/phusion_passenger/request_handler/thread_handler.rb /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.38/lib/phusion_passenger/request_handler.rb /usr/local/lib/ruby/1.9.1/x86_64-linux/stringio.so /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.38/lib/phusion_passenger/utils/tee_input.rb /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.38/lib/phusion_passenger/rack/thread_handler_extension.rb /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.38/lib/phusion_passenger/analytics_logger.rb /usr/local/lib/ruby/1.9.1/rubygems/version.rb /usr/local/lib/ruby/1.9.1/rubygems/requirement.rb /usr/local/lib/ruby/1.9.1/rubygems/platform.rb /usr/local/lib/ruby/1.9.1/rubygems/specification.rb /usr/local/lib/ruby/1.9.1/rubygems/path_support.rb 由 Phusion Passenger 提供支持,用于 Apache 和 nginx 的 mod_rails / mod_rack。In file httpd.conf, i did not change anything from this:
<pre>
LoadModule passenger_module /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.38/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
PassengerRoot /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.38
PassengerDefaultRuby /usr/local/bin/ruby
</IfModule>
</pre>
我没有安装 RVM
$ gem evn
RubyGems 环境: - 红宝石版本:1.3.7 - 红宝石版本:1.8.7(2011-06-30 补丁级别 352)[x86_64-linux] - 安装目录:/usr/lib/ruby/gems/1.8 - 红宝石可执行文件:/usr/bin/ruby - 可执行目录:/usr/bin - 红宝石平台: - 红宝石 - x86_64-linux - 宝石路径: - /usr/lib/ruby/gems/1.8 - /root/.gem/ruby/1.8 - 宝石配置: - :update_sources => 真 - :详细 => 真 - :基准 => 假 - :回溯 => 假 - :bulk_threshold => 1000 - 远程资源: - http://rubygems.org/$宝石列表
*** 当地宝石 *** actionmailer (3.2.17) 动作包 (3.2.17) 活动模型(3.2.17) 活动记录(3.2.17) 活动资源 (3.2.17) 积极支持 (3.2.17) 阿雷尔 (5.0.1.20140414130214, 3.0.3) 生成器(3.2.2、3.0.0) 捆绑器(1.6.5、1.3.0) 码雷 (1.1.0) 厄鲁比斯 (2.7.0) 更快的csv(1.5.5) 哈希(3.2.0) 远足 (1.2.3) hodel_3000_compliant_logger (0.1.1) i18n (0.6.9) 旅程 (1.0.4) jquery-rails (2.0.3) json (1.8.1) 邮件(2.6.1、2.5.4) 哑剧类型 (1.25.1) multi_json (1.10.1, 1.9.0) mysql2 (0.3.15) 网络 ldap (0.3.1) 全域认证 (1.2.2) omniauth-shibboleth (1.1.2) orm_adapter (0.5.0) 多语言 (0.3.5, 0.3.4) 机架(1.5.2、1.4.5) 机架缓存 (1.2) 机架 SSL (1.4.1, 1.3.3) 机架测试(0.6.2) 铁路 (3.2.17) 耙子 (10.3.2, 10.1.1, 0.8.7) rdoc (4.1.1, 3.12.2) rdoc 数据 (4.0.1) shibboleth_auth (0.3.3) 链轮 (2.12.1, 2.2.2) 雷神 (0.18.1) 线程安全(0.3.4) 倾斜 (2.0.1, 1.4.1) 树顶 (1.5.3, 1.4.15) tzinfo (1.2.1, 0.3.39) 典狱长 (1.2.3)$ ruby -v
<pre>
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
</pre>
<pre>
$ which bundler
/usr/bin/bundler
$ which ruby
/usr/bin/ruby
$ which gem
/usr/bin/gem
我无法重新安装 Redmine,因为其他用户正在使用它。
请给出解决这个问题的任何想法。
【问题讨论】:
【参考方案1】:路径表示正在使用的不同版本的 Ruby。
当您从命令行运行ruby -v
时,它显示的是 1.8.7
您的PassengerRoot
表示/usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.38
中的2.0.0(gems
下的目录表示构建gem 的Ruby 版本)
顶部的错误信息表示RUBY_VERSION = 1.9.3
您最好的做法可能是卸载不需要的 Ruby 版本,然后重新安装Passenger 和 Redmine。
【讨论】:
你好蒂姆,谢谢你的回答。不幸的是,我在 Ruby 方面不是很好,所以我不知道如何卸载从源代码安装的 Ruby 1.9.3(由于多种原因,我无法在系统上重新安装Passenger & Redmine)。因此,我的解决方案是为 Ruby 1.9.3 安装所需的 gem。我接受你的回答,因为你给了我主要的问题点:我的系统上有 2 个版本的 Ruby。非常感谢和最好的问候! :)【参考方案2】:您的乘客在终端使用其他 ruby 版本。所以,正如我所见,乘客使用 /usr/local/bin/ruby。
尝试在这个 ruby 中安装 bundler /usr/local/bin/gem install bundler
。
然后我认为你必须从 redmine 根路径运行 /usr/local/bin/bundle install
【讨论】:
你好 vladdruzh,是的,你是对的。 root 用户使用 Ruby v1.8.7,普通用户使用 Ruby 1.9.3。我以与您类似的方式解决了我的问题。但我认为你的解决方案是正确的! :) 非常感谢和最好的问候!注意:“不要以 root 身份运行 Bundler。如果需要,Bundler 可以要求使用 sudo,并且以 root 身份安装您的 bundle 会破坏此机器上所有非 root 用户的应用程序。”以上是关于Redmine 2.4.4 - 无法启动 Web 应用程序的主要内容,如果未能解决你的问题,请参考以下文章