<< 20160701-setup-davaz-com | Index | template >>
I've checked current (ruby) status and location before to try fixing it.
$ s -la /usr/local/bin/ruby* -rwxr-xr-x 1 root root 2572289 15. Mär 22:43 /usr/local/bin/ruby -rwxr-xr-x 1 root root 8094 16. Mär 18:40 /usr/local/bin/ruby186 lrwxrwxrwx 1 root root 4 14. Dez 2011 /usr/local/bin/ruby193 -> ruby
$ ls -la /usr/bin/ruby* lrwxrwxrwx 1 root root 16 18. Feb 2010 /usr/bin/ruby -> //usr/bin/ruby18 -rwxr-xr-x 1 root root 6112 30. Jul 2009 /usr/bin/ruby1.9 -rwxr-xr-x 1 root root 6104 6. Apr 2009 /usr/bin/ruby18 -rwxr-xr-x 1 root root 1244860 16. Mär 18:05 /usr/bin/ruby186 -rwxr-xr-x 1 root root 386 18. Feb 2010 /usr/bin/rubyforge
# ldd /usr/lib/apache2/modules/mod_ruby.so linux-vdso.so.1 (0x00007ffe2c7ba000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f0e81731000) librt.so.1 => /lib64/librt.so.1 (0x00007f0e81529000) libdl.so.2 => /lib64/libdl.so.2 (0x00007f0e81325000) libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007f0e810ed000) libm.so.6 => /lib64/libm.so.6 (0x00007f0e80de9000) libc.so.6 => /lib64/libc.so.6 (0x00007f0e80a3b000) /lib64/ld-linux-x86-64.so.2 (0x00007f0e81dd3000)
I've tried to avoid this error, it seems good. But after this, Apache causes still Segmentation fault.
$ sudo /etc/init.d/apache2 restart * apache2 has detected an error in your setup: apache2: Syntax error on line 155 of /etc/apache2/httpd.conf: Syntax error on line 3 of /etc/apache2/modules.d/21_mod_ruby.conf: Cannot load /usr/lib64/apache2/modules/mod_ruby186.so into server: /usr/lib64/apache2/modules/mod_ruby186.so: undefined symbol: rb_block_lambda * ERROR: apache2 failed to stop
mod_ruby/request.c
1774 //#if RUBY_VM || RUBY_RELEASE_CODE > 20030616 1775 // plain_cleanup = rb_block_lambda(); 1776 //#else 1777 plain_cleanup = rb_f_lambda(); 1778 //#endif
I've found old rubies at here:
http://ftp.ruby-lang.org/pub/ruby/1.8/
And tried to compile with various patch level ruby186 with oniguruma patch. But its are also same result.
I've noticed that there are many various errors in error_log of apache. So, I've reduced these.
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- auto_gem (LoadError) from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require' /usr/local/lib/ruby/gems/1.9.1/gems/sbsm-1.2.3/lib/sbsm/trans_handler.rb:14: warning: already initialized constant CONFIG_PATH /usr/local/lib/ruby/gems/1.9.1/gems/sbsm-1.2.3/lib/sbsm/trans_handler.rb:18: warning: already initialized constant HANDLER_URI
Set RUBYOPT in config files of apache.
SetEnv RUBYOPT ''
And to avoid this error in ruby application on Gentoo, often I do this:
$ cat /etc/conf.d/99ruby RUBYOPT=""
I've also set this global environment variable on Thinpower.
[Sat Mar 19 00:06:08 2016] [error] mod_ruby: /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:135:in `require': cannot load such file -- sbsm/trans_handler (LoadError) [Sat Mar 19 00:06:08 2016] [error] mod_ruby: from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:135:in `rescue in require' [Sat Mar 19 00:06:08 2016] [error] mod_ruby: from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:144:in `require' [Sat Mar 19 00:06:08 2016] [error] mod_ruby: failed to require sbsm/trans_handler [Sat Mar 19 00:06:08 2016] [error] mod_ruby: error in ruby
First, I've tried to sbsm installed to ruby1.9.3 and mod_ruby compiled against 1.9.3 for de.oddb.org. Because currently mod_ruby is compiled against 1.9.3 and some application such as ch.oddb.org work fine.
RubyAddPath /usr/local/lib64/ruby/gems/1.9.1/gems/sbsm-1.2.3/lib
But, de.oddb.org/ydpm/ydim doesn't work. So, then I've tried to use sbsm installed for ruby1.8 (in site_ruby).
Apache config files (/etc/apache2/vhosts.d/)
RubyAddPath RubyAddPath /usr/lib64/ruby/site_ruby/1.8/
This cases still some issues.
rockit in site_ruby (in ruby 1.8) had issues to work for mod_ruby compiled against ruby 1.9.3.
[Sat Mar 19 00:07:06 2016] [error] mod_ruby: /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require': /usr/lib64/ruby/site_ruby/1.8/rockit/token.rb:138: invalid multibyte char (US-ASCII) (SyntaxError) [Sat Mar 19 00:07:06 2016] [error] mod_ruby: /usr/lib64/ruby/site_ruby/1.8/rockit/token.rb:138: syntax error, unexpected '~', expecting ')' [Sat Mar 19 00:07:06 2016] [error] mod_ruby: super("EOF", "\xa4~~\xa4\xa4~^^~" + rand(1e10).inspect) [Sat Mar 19 00:07:06 2016] [error] mod_ruby: ^ [Sat Mar 19 00:07:06 2016] [error] mod_ruby: /usr/lib64/ruby/site_ruby/1.8/rockit/token.rb:138: invalid multibyte char (US-ASCII) [Sat Mar 19 00:07:06 2016] [error] mod_ruby: from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require' [Sat Mar 19 00:07:06 2016] [error] mod_ruby: from /usr/lib64/ruby/site_ruby/1.8/rockit/grammar.rb:1:in `<top (required)>' [Sat Mar 19 00:07:06 2016] [error] mod_ruby: from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require' [Sat Mar 19 00:07:06 2016] [error] mod_ruby: from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require' [Sat Mar 19 00:07:06 2016] [error] mod_ruby: from /usr/lib64/ruby/site_ruby/1.8/rockit/lalr_parsetable_generator.rb:1:in `<top (required)>' [Sat Mar 19 00:07:06 2016] [error] mod_ruby: from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require' [Sat Mar 19 00:07:06 2016] [error] mod_ruby: from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require' [Sat Mar 19 00:07:06 2016] [error] mod_ruby: from /usr/lib64/ruby/site_ruby/1.8/rockit/rockit.rb:2:in `<top (required)>' [Sat Mar 19 00:07:06 2016] [error] mod_ruby: from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require' [Sat Mar 19 00:07:06 2016] [error] mod_ruby: from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require' [Sat Mar 19 00:07:06 2016] [error] mod_ruby: from /usr/lib64/ruby/site_ruby/1.8/sbsm/trans_handler.rb:5:in `<top (required)>' [Sat Mar 19 00:07:06 2016] [error] mod_ruby: from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require' [Sat Mar 19 00:07:06 2016] [error] mod_ruby: from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require' [Sat Mar 19 00:07:06 2016] [error] mod_ruby: failed to require sbsm/trans_handler [Sat Mar 19 00:07:06 2016] [error] mod_ruby: error in ruby
Then, Add 'encoding: utf-8' and set fileencoding as utf-8 (:set fileencoding=utf-8, in vim)
/usr/lib64/ruby/site_ruby/1.8/rockit/token.rb /usr/lib64/ruby/site_ruby/1.8/rockit/rockit_grammars_parser.rb
Encoding is Class in ruby 1.9.3, but encoding in site_ruby/1.8 defines as Module.
[Sat Mar 19 02:26:24 2016] [error] mod_ruby: error in ruby [Sat Mar 19 02:26:24 2016] [error] mod_ruby: /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require': Class is not a module (TypeError) [Sat Mar 19 02:26:24 2016] [error] mod_ruby: from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require' [Sat Mar 19 02:26:24 2016] [error] mod_ruby: from /usr/lib64/ruby/site_ruby/1.8/encoding/character/utf-8.rb:5:in `<top (required)>' [Sat Mar 19 02:26:24 2016] [error] mod_ruby: from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require' [Sat Mar 19 02:26:24 2016] [error] mod_ruby: from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require' [Sat Mar 19 02:26:24 2016] [error] mod_ruby: from /var/www/de.oddb.org/doc/index.rbx:6:in `<top (required)>' [Sat Mar 19 02:26:24 2016] [error] mod_ruby: from /usr/local/lib/ruby/1.9.1/apache/ruby-run.rb:53:in `load' [Sat Mar 19 02:26:24 2016] [error] mod_ruby: from /usr/local/lib/ruby/1.9.1/apache/ruby-run.rb:53:in `handler'
Then, edit index.rbx file in /var/www/de.oddb.org/doc/index.rbx
There are some strange small issues (in de.oddb.org), but ch.oddb.org, de.oddb.org, ydim and ydpm works in above condition for now.
It is very complicated and isn't maintainable, So It has to be fix with more good setup, as soon as possible.