Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/58.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails rails应用程序的乘客繁殖错误_Ruby On Rails_Apache_Passenger_Configuration Files - Fatal编程技术网

Ruby on rails rails应用程序的乘客繁殖错误

Ruby on rails rails应用程序的乘客繁殖错误,ruby-on-rails,apache,passenger,configuration-files,Ruby On Rails,Apache,Passenger,Configuration Files,我正在apache/passenger/ubuntu上运行rails 4应用程序。当我注释掉config/environments/production.rb中的config_serve.static.assets行时,应用程序运行良好,如下所示: # Disable Rails's static asset server (Apache or NGINX will already do this). # config.serve_static_assets = false  虽然它可以工作,

我正在apache/passenger/ubuntu上运行rails 4应用程序。当我注释掉config/environments/production.rb中的config_serve.static.assets行时,应用程序运行良好,如下所示:

# Disable Rails's static asset server (Apache or NGINX will already do this).
# config.serve_static_assets = false 
虽然它可以工作,但注释掉这一行似乎是个坏主意,因为我已经读到config变量的默认值为true,并且当您在apache或nginx后面运行应用程序时,应该将其设置为false。但是,当我取消注释该行时,应用程序不会启动,并且在apache错误日志中出现以下错误:

[Client 20] Cannot checkout session because a spawning error occurred. The identifier of the error is 108162e2. Please see earlier logs for details about the error.
App 10751 stdout:
App 10751 stderr:  --> Compiling passenger_native_support.so for the current Ruby interpreter...
App 10751 stderr:
App 10751 stderr:      (set PASSENGER_COMPILE_NATIVE_SUPPORT_BINARY=0 to disable)
App 10751 stderr:
App 10751 stderr:  --> Downloading precompiled passenger_native_support.so for the current Ruby interpreter...
App 10751 stderr:
App 10751 stderr:      (set PASSENGER_DOWNLOAD_NATIVE_SUPPORT_BINARY=0 to disable)
App 10751 stderr:
App 10751 stderr:      # tar xzf rubyext-ruby-2.1.3-x86_64-linux.tar.gz
App 10751 stderr:      # rm -f rubyext-ruby-2.1.3-x86_64-linux.tar.gz
App 10751 stderr:      Checking whether downloaded binary is usable...
App 10751 stderr:      # /usr/local/bin/ruby -I. test.rb
App 10751 stderr:      /usr/local/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require': libruby.so.2.1: cannot open shared object file: No such file or directory - /tmp/passenger-native-support-j3v7kx/passenger_native_support.so (LoadError)
App 10751 stderr:       from /usr/local/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
App 10751 stderr:       from test.rb:2:in `<main>'
App 10751 stderr:      Binary is not usable.
App 10751 stderr:  --> Continuing without passenger_native_support.so.
App 10751 stdout:
[ 2015-01-21 10:13:18.0841 10166/7fce0acf9700 Pool2/Implementation.cpp:287 ]: Could not spawn process for application /home/DFM: An error occured while starting up the preloader.
  Error ID: 4b40f65d
  Error details saved to: /tmp/passenger-error-tH49HR.html
  Message from application: undefined local variable or method `false ' for #<Dfm::Application:0x007f4afb293b30> (NameError)
  /home/DFM/config/environments/production.rb:24:in `block in <top (required)>'
  /usr/local/lib/ruby/gems/2.1.0/gems/railties-4.2.0.rc2/lib/rails/railtie.rb:210:in `instance_eval'
  /usr/local/lib/ruby/gems/2.1.0/gems/railties-4.2.0.rc2/lib/rails/railtie.rb:210:in `configure'
  /home/DFM/config/environments/production.rb:1:in `<top (required)>'
[Client 20]无法签出会话,因为发生了生成错误。错误的标识符是108162e2。有关错误的详细信息,请参阅前面的日志。
App 10751标准件:
App 10751 stderr:-->正在编译passenger\u native\u support.so以用于当前的Ruby解释器。。。
App 10751标准:
App 10751标准:(将乘客\u编译\u本地\u支持\u二进制=0设置为禁用)
App 10751标准:
App 10751 stderr:-->正在下载预编译的passenger\u native\u support.so对于当前的Ruby解释器。。。
App 10751标准:
App 10751标准:(将乘客\下载\本地\支持\二进制=0设置为禁用)
App 10751标准:
App 10751标准说明:#tar xzf rubyext-ruby-2.1.3-x86_64-linux.tar.gz
App 10751标准说明:#rm-f rubyext-ruby-2.1.3-x86_64-linux.tar.gz
App 10751标准:检查下载的二进制文件是否可用。。。
App 10751 stderr:#/usr/local/bin/ruby-I.test.rb
App 10751 stderr:/usr/local/lib/ruby/2.1.0/rubygems/core\u ext/kernel\u require.rb:55:in'require':libruby.so.2.1:无法打开共享对象文件:没有这样的文件或目录-/tmp/passer-native-support-j3v7kx/passer\u native\u support.so(LoadError)
App 10751 stderr:from/usr/local/lib/ruby/2.1.0/rubygems/core\u ext/kernel\u require.rb:55:in'require'
App 10751标准:来自测试。rb:2:in`'
App 10751标准:二进制文件不可用。
App 10751标准:-->在没有乘客支持的情况下继续。so。
App 10751标准件:
[2015-01-21 10:13:18.0841 10166/7fce0acf9700 Pool2/Implementation.cpp:287]:无法为应用程序/home/DFM生成进程:启动预加载程序时出错。
错误ID:4b40f65d
错误详细信息保存到:/tmp/passenger-Error-tH49HR.html
来自应用程序的消息:未定义的局部变量或#的“false”方法(NameError)
/home/DFM/config/environments/production.rb:24:in'block in'
/usr/local/lib/ruby/gems/2.1.0/gems/railties-4.2.0.rc2/lib/rails/railtie.rb:210:in'instance_eval'
/usr/local/lib/ruby/gems/2.1.0/gems/railties-4.2.0.rc2/lib/rails/railtie.rb:210:在“配置”中
/home/DFM/config/environments/production.rb:1:in`'
因此,我的问题是(1)在运行应用程序时注释掉config变量(因此默认为true)是否有问题,以及(2)如果有问题,如何解决

  • 不推荐使用,但可能只是性能问题
  • 重要的错误信息隐藏在一系列乘客警告中:

    Message from application: undefined local variable or method `false ' for #<Dfm::Application:0x007f4afb293b30> (NameError)
    /home/DFM/config/environments/production.rb:24:in `block in <top (required)>'
    
    来自应用程序的消息:未定义的局部变量或#的方法'false'(NameError)
    /home/DFM/config/environments/production.rb:24:in'block in'
    
  • 我相信您现在已经解决了这个问题,但是将来看到这个页面的乘客用户可能会因为与乘客本地支持相关的警告而分心,这些警告与错误本身无关。