Oniguruma 1.1.0与Ruby 2.3.1不兼容

时间:2016-06-14 08:32:57

标签: ruby-on-rails installation oniguruma

我安装了ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]rails 4.2.6。我写了一个Gemfile,其中包含所有捆绑包 Gemfile:

source 'http://rubygems.org'
source 'http://gems.github.com'

#New gem files from Ajay
#gem 'activesupport', '4.2.6'

gem 'rails', '4.2.6'

gem 'rake','0.8.7'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

#gem 'mysql2', '0.2.6'
gem 'mysql2', '0.3.20'

# GUID generator
gem 'uuidtools', '2.1.2'

# Paperclip: for image resizing
gem 'paperclip', '2.4'

# Delayed job
gem 'delayed_job', '4.1.2'

# Typus, admin interface
gem 'typus', '3.0.2'

# set attribute value to nil if blank
gem "nilify_blanks", '1.0.0'

# ssl gem
gem "bartt-ssl_requirement", "~> 1.2.7", :require => 'ssl_requirement'

# for social login
gem 'omniauth', '1.3.1'

# to detect user location
gem 'geocoder', '1.1.0'

# use to sanitize html
gem 'sanitize', '4.0.1'

# captcha for registration
gem 'recaptcha', '0.3.1', :require => "recaptcha/rails"

# base 32
gem 'base32', '0.1.3'

# amazon s3
gem 'aws-s3', '0.6.2'

#json
gem 'json', '1.8.3'

# pagination
gem 'will_paginate', '3.0.pre2'

# jammit for asset packaging
gem 'jammit', '0.6.3'

gem 'oniguruma'

# Use unicorn as the web server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger (ruby-debug for Ruby 1.8.7+, ruby-debug19 for Ruby 1.9.2+)
# gem 'ruby-debug'
# gem 'ruby-debug19'

# Bundle the extra gems:
# gem 'bj'
# gem 'nokogiri', "1.4.4.1"
# gem 'sqlite3-ruby', :require => 'sqlite3'
# gem 'aws-s3', :require => 'aws/s3'

# Bundle gems for the local environment. Make sure to
# put test-only gems in this group so their generators
# and rake tasks are available in development mode:
# group :development, :test do
#   gem 'webrat'
# end

gem "fb_graph", "1.9.5"

gem 'sitemap_generator', '2.1.8'

gem 'fastercsv', "1.5.5"

# to make it the same prior to 3.018 upgrade

gem 'addressable', "2.2.4"
gem 'arel', "6.0"
gem 'attr_required', '0.0.3'

gem 'cocaine', "0.2.0"
gem 'daemons', "1.1.0"

gem 'httpclient', '2.2.1'
gem 'i18n', '~> 0.7'

gem 'mail', '2.5.4'

gem 'mime-types', '1.16'
gem 'multipart-post', '1.1.0'
gem 'nokogiri', '~> 1.6.0'
gem 'oauth', '0.4.4'
gem 'open4', '1.2.0'
gem 'polyglot', '0.3.1'
gem 'pyu-ruby-sasl', '0.0.3.2'
gem 'rack', '1.6'
gem 'rack-mount', '0.6.13'
gem 'rack-oauth2', '0.9.2'
gem 'rack-test', '~> 0.6.2'
gem 'rest-client', '1.6.1'
gem 'ruby-openid', '2.1.8'
gem 'treetop', '1.4.9'
gem 'tzinfo', '1.1'
gem 'xml-simple', '1.0.15'

但是当我尝试安装oniguruma时,我收到以下错误:

Installing oniguruma 1.1.0 with native extensions

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /root/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/oniguruma-1.1.0/ext
/root/.rbenv/versions/2.3.1/bin/ruby -r ./siteconf20160614-24717-1q0k49a.rb extconf.rb
checking for main() in -lonig... yes
creating Makefile

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /root/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/extensions/x86_64-linux/2.3.0-static/oniguruma-1.1.0/mkmf.log

current directory: /root/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/oniguruma-1.1.0/ext
make "DESTDIR=" clean

current directory: /root/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/oniguruma-1.1.0/ext
make "DESTDIR="
compiling oregexp.c
oregexp.c: In function ‘name_callback’:
oregexp.c:111:7: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness [-Wpointer-sign]
       rb_hash_aset( nameHash, ID2SYM(rb_intern(name)), INT2FIX( gn ) );
       ^
In file included from /root/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/defines.h:45:0,
                 from /root/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:36,
                 from /root/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby.h:33,
                 from oregexp.c:1:
/usr/include/string.h:399:15: note: expected ‘const char *’ but argument is of type ‘const OnigUChar *’
 extern size_t strlen (const char *__s)
               ^
oregexp.c:111:7: warning: pointer targets in passing argument 1 of ‘rb_intern2’ differ in signedness [-Wpointer-sign]
       rb_hash_aset( nameHash, ID2SYM(rb_intern(name)), INT2FIX( gn ) );
       ^
In file included from /root/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby.h:33:0,
                 from oregexp.c:1:
/root/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1711:4: note: expected ‘const char *’ but argument is of type ‘const OnigUChar *’
 ID rb_intern2(const char*, long);
    ^
oregexp.c:111:7: warning: pointer targets in passing argument 1 of ‘rb_intern’ differ in signedness [-Wpointer-sign]
       rb_hash_aset( nameHash, ID2SYM(rb_intern(name)), INT2FIX( gn ) );
       ^
In file included from /root/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby.h:33:0,
                 from oregexp.c:1:
/root/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1710:4: note: expected ‘const char *’ but argument is of type ‘const OnigUChar *’
 ID rb_intern(const char*);
    ^
oregexp.c: In function ‘oregexp_initialize’:
oregexp.c:123:41: error: ‘struct RString’ has no member named ‘ptr’
    UChar* pat_ptr = RSTRING(pattern_str)->ptr;
                                         ^
oregexp.c:124:38: error: ‘struct RString’ has no member named ‘len’
    int pat_len = RSTRING(pattern_str)->len;
                                      ^
oregexp.c:138:7: warning: pointer targets in passing argument 1 of ‘onig_error_code_to_str’ differ in signedness [-Wpointer-sign]
       onig_error_code_to_str(s, r, &einfo);
       ^
In file included from oregexp.c:2:0:
/usr/local/include/oniguruma.h:721:5: note: expected ‘OnigUChar *’ but argument is of type ‘char *’
 int onig_error_code_to_str PV_((OnigUChar* s, int err_code, ...));
     ^
oregexp.c: In function ‘oregexp_make_match_data’:
oregexp.c:156:5: warning: passing argument 1 of ‘rb_obj_setup’ makes integer from pointer without a cast [enabled by default]
     OBJSETUP(match, rb_cMatch, T_MATCH);
     ^
In file included from /root/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby.h:33:0,
                 from oregexp.c:1:
/root/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:771:7: note: expected ‘VALUE’ but argument is of type ‘struct RMatch *’
 VALUE rb_obj_setup(VALUE obj, VALUE klass, VALUE type);
       ^
oregexp.c:176:9: warning: passing argument 2 of ‘onig_foreach_name’ from incompatible pointer type [enabled by default]
         onig_foreach_name(oregexp->reg, name_callback, &packet);
         ^
In file included from oregexp.c:2:0:
/usr/local/include/oniguruma.h:760:5: note: expected ‘int (*)(const OnigUChar *, const OnigUChar *, int,  int *, struct OnigRegexType *, void *)’ but argument is of type ‘int (*)(const OnigUChar *, const OnigUChar *, int,  int *, struct regex_t *, struct callback_packet *)’
 int onig_foreach_name P_((OnigRegex reg, int (*func)(const OnigUChar*, const OnigUChar*,int,int*,OnigRegex,void*), void* arg));
     ^
oregexp.c: In function ‘oregexp_match’:
oregexp.c:211:7: warning: statement with no effect [-Wunused-value]
       exit;
       ^
oregexp.c:215:40: error: ‘struct RString’ has no member named ‘ptr’
    UChar* str_ptr = RSTRING(string_str)->ptr;
                                        ^
oregexp.c:216:37: error: ‘struct RString’ has no member named ‘len’
    int str_len = RSTRING(string_str)->len;
                                     ^
oregexp.c:244:7: warning: pointer targets in passing argument 1 of ‘onig_error_code_to_str’ differ in signedness [-Wpointer-sign]
       onig_error_code_to_str(s, r);
       ^
In file included from oregexp.c:2:0:
/usr/local/include/oniguruma.h:721:5: note: expected ‘OnigUChar *’ but argument is of type ‘char *’
 int onig_error_code_to_str PV_((OnigUChar* s, int err_code, ...));
     ^
oregexp.c: In function ‘oregexp_append_replacement’:
oregexp.c:267:52: error: ‘struct RString’ has no member named ‘len’
     int32_t  replacementLength = RSTRING(repl_text)->len;
                                                    ^
oregexp.c:268:51: error: ‘struct RString’ has no member named ‘ptr’
     UChar    *replacementText = RSTRING(repl_text)->ptr;
                                                   ^
oregexp.c:277:34: error: ‘struct RString’ has no member named ‘ptr’
     matchText = RSTRING(src_text)->ptr;
                                  ^
oregexp.c:278:34: error: ‘struct RString’ has no member named ‘len’
     matchLen  = RSTRING(src_text)->len;
                                  ^
oregexp.c:293:6: warning: pointer targets in passing argument 2 of ‘rb_str_cat’ differ in signedness [-Wpointer-sign]
      rb_str_buf_cat( ret, replacementText+replIdx-c_len, c_len);
      ^
In file included from /root/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1992:0,
                 from /root/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby.h:33,
                 from oregexp.c:1:
/root/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/intern.h:758:7: note: expected ‘const char *’ but argument is of type ‘OnigUChar *’
 VALUE rb_str_cat(VALUE, const char*, long);
       ^
oregexp.c:297:17: warning: pointer targets in passing argument 2 of ‘rb_str_cat’ differ in signedness [-Wpointer-sign]
                 rb_str_buf_cat(ret, replacementText+(replIdx-c_len), c_len);
                 ^
In file included from /root/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1992:0,
                 from /root/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby.h:33,
                 from oregexp.c:1:
/root/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/intern.h:758:7: note: expected ‘const char *’ but argument is of type ‘OnigUChar *’
 VALUE rb_str_cat(VALUE, const char*, long);
       ^
oregexp.c:328:5: warning: pointer targets in passing argument 2 of ‘rb_str_cat’ differ in signedness [-Wpointer-sign]
     rb_str_buf_cat(ret, matchText+region->beg[0], region->end[0] - region->beg[0]);
     ^
In file included from /root/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1992:0,
                 from /root/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby.h:33,
                 from oregexp.c:1:
/root/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/intern.h:758:7: note: expected ‘const char *’ but argument is of type ‘const OnigUChar *’
 VALUE rb_str_cat(VALUE, const char*, long);
       ^
oregexp.c:332:33: warning: pointer targets in passing argument 2 of ‘rb_str_cat’ differ in signedness [-Wpointer-sign]
                                 rb_str_buf_cat(ret, matchText, region->beg[0]);
                                 ^
In file included from /root/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1992:0,
                 from /root/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby.h:33,
                 from oregexp.c:1:
/root/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/intern.h:758:7: note: expected ‘const char *’ but argument is of type ‘const OnigUChar *’
 VALUE rb_str_cat(VALUE, const char*, long);
       ^
oregexp.c:336:5: warning: pointer targets in passing argument 2 of ‘rb_str_cat’ differ in signedness [-Wpointer-sign]
     rb_str_buf_cat(ret, matchText+region->end[0], matchLen - region->end[0]);
     ^
In file included from /root/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1992:0,
                 from /root/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby.h:33,
                 from oregexp.c:1:
/root/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/intern.h:758:7: note: expected ‘const char *’ but argument is of type ‘const OnigUChar *’
 VALUE rb_str_cat(VALUE, const char*, long);
       ^
oregexp.c:341:5: warning: pointer targets in passing argument 2 of ‘rb_str_cat’ differ in signedness [-Wpointer-sign]
     rb_str_buf_cat(ret, replacementText+replIdx, c_len);
     ^
In file included from /root/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1992:0,
                 from /root/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby.h:33,
                 from oregexp.c:1:
/root/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/intern.h:758:7: note: expected ‘const char *’ but argument is of type ‘OnigUChar *’
 VALUE rb_str_cat(VALUE, const char*, long);
       ^
oregexp.c:350:10: warning: pointer targets in passing argument 2 of ‘rb_str_cat’ differ in signedness [-Wpointer-sign]
          rb_str_buf_cat(ret, matchText+g_start, g_end-g_start);
          ^
In file included from /root/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1992:0,
                 from /root/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby.h:33,
                 from oregexp.c:1:
/root/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/intern.h:758:7: note: expected ‘const char *’ but argument is of type ‘const OnigUChar *’
 VALUE rb_str_cat(VALUE, const char*, long);
       ^
oregexp.c:371:8: warning: pointer targets in passing argument 2 of ‘rb_str_cat’ differ in signedness [-Wpointer-sign]
        rb_str_buf_cat(ret, replacementText+(replIdx-p_len), p_len+c_len);
        ^
In file included from /root/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1992:0,
                 from /root/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby.h:33,
                 from oregexp.c:1:
/root/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/intern.h:758:7: note: expected ‘const char *’ but argument is of type ‘OnigUChar *’
 VALUE rb_str_cat(VALUE, const char*, long);
       ^
oregexp.c:379:10: warning: pointer targets in passing argument 2 of ‘rb_str_cat’ differ in signedness [-Wpointer-sign]
          region->end[groupNum]-region->beg[groupNum]);
          ^
In file included from /root/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1992:0,
                 from /root/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby.h:33,
                 from oregexp.c:1:
/root/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/intern.h:758:7: note: expected ‘const char *’ but argument is of type ‘const OnigUChar *’
 VALUE rb_str_cat(VALUE, const char*, long);
       ^
oregexp.c:385:33: warning: pointer targets in passing argument 2 of ‘rb_str_cat’ differ in signedness [-Wpointer-sign]
                                 rb_str_buf_cat(ret, replacementText+(replIdx-p_len), p_len+c_len);
                                 ^
In file included from /root/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1992:0,
                 from /root/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby.h:33,
                 from oregexp.c:1:
/root/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/intern.h:758:7: note: expected ‘const char *’ but argument is of type ‘OnigUChar *’
 VALUE rb_str_cat(VALUE, const char*, long);
       ^
oregexp.c:392:9: warning: pointer targets in passing argument 2 of ‘rb_str_cat’ differ in signedness [-Wpointer-sign]
         rb_str_buf_cat(ret, matchText+region->beg[groupNum], region->end[groupNum]-region->beg[groupNum]);
         ^
In file included from /root/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1992:0,
                 from /root/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby.h:33,
                 from oregexp.c:1:
/root/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/intern.h:758:7: note: expected ‘const char *’ but argument is of type ‘const OnigUChar *’
 VALUE rb_str_cat(VALUE, const char*, long);
       ^
oregexp.c: In function ‘str_mod_check’:
oregexp.c:405:16: error: ‘struct RString’ has no member named ‘ptr’
  if (RSTRING(s)->ptr != p || RSTRING(s)->len != len) {
                ^
oregexp.c:405:40: error: ‘struct RString’ has no member named ‘len’
  if (RSTRING(s)->ptr != p || RSTRING(s)->len != len) {
                                        ^
oregexp.c: In function ‘oregexp_gsub’:
oregexp.c:444:41: error: ‘struct RString’ has no member named ‘ptr’
     UChar* str_ptr = RSTRING(string_str)->ptr;
                                         ^
oregexp.c:445:38: error: ‘struct RString’ has no member named ‘len’
     int str_len = RSTRING(string_str)->len;
                                      ^
oregexp.c:462:2: warning: pointer targets in passing argument 2 of ‘rb_str_cat’ differ in signedness [-Wpointer-sign]
  rb_str_buf_cat(buf, str_ptr+prev_end, beg-prev_end);
  ^
In file included from /root/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1992:0,
                 from /root/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby.h:33,
                 from oregexp.c:1:
/root/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/intern.h:758:7: note: expected ‘const char *’ but argument is of type ‘OnigUChar *’
 VALUE rb_str_cat(VALUE, const char*, long);
       ^
oregexp.c:484:12: warning: pointer targets in passing argument 2 of ‘rb_str_cat’ differ in signedness [-Wpointer-sign]
            rb_str_buf_cat( buf, str_ptr+end, len);
            ^
In file included from /root/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1992:0,
                 from /root/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby.h:33,
                 from oregexp.c:1:
/root/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/intern.h:758:7: note: expected ‘const char *’ but argument is of type ‘OnigUChar *’
 VALUE rb_str_cat(VALUE, const char*, long);
       ^
oregexp.c:491:5: warning: pointer targets in passing argument 2 of ‘rb_str_cat’ differ in signedness [-Wpointer-sign]
     rb_str_buf_cat( buf, str_ptr+end, str_len - end);
     ^
In file included from /root/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1992:0,
                 from /root/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby.h:33,
                 from oregexp.c:1:
/root/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/intern.h:758:7: note: expected ‘const char *’ but argument is of type ‘OnigUChar *’
 VALUE rb_str_cat(VALUE, const char*, long);
       ^
oregexp.c: In function ‘oregexp_safe_gsub’:
oregexp.c:527:9: warning: passing argument 3 of ‘rb_ensure’ from incompatible pointer type [enabled by default]
         return rb_ensure( oregexp_packed_gsub, (VALUE)&call_args, oregexp_cleanup_region, (VALUE)region);
         ^
In file included from /root/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby.h:33:0,
                 from oregexp.c:1:
/root/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1840:7: note: expected ‘VALUE (*)()’ but argument is of type ‘void (*)(struct OnigRegion *)’
 VALUE rb_ensure(VALUE(*)(ANYARGS),VALUE,VALUE(*)(ANYARGS),VALUE);
       ^
oregexp.c: In function ‘oregexp_scan’:
oregexp.c:614:41: error: ‘struct RString’ has no member named ‘ptr’
     UChar* str_ptr = RSTRING(string_str)->ptr;
                                         ^
oregexp.c:615:38: error: ‘struct RString’ has no member named ‘len’
     int str_len = RSTRING(string_str)->len;
                                      ^
oregexp.c: In function ‘oregexp_m_scan’:
oregexp.c:671:5: warning: passing argument 3 of ‘rb_ensure’ from incompatible pointer type [enabled by default]
     return rb_ensure( oregexp_packed_scan, (VALUE)&call_args, oregexp_cleanup_region, (VALUE)region);
     ^
In file included from /root/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby.h:33:0,
                 from oregexp.c:1:
/root/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1840:7: note: expected ‘VALUE (*)()’ but argument is of type ‘void (*)(struct OnigRegion *)’
 VALUE rb_ensure(VALUE(*)(ANYARGS),VALUE,VALUE(*)(ANYARGS),VALUE);
       ^
make: *** [oregexp.o] Error 1

make failed, exit code 2

Gem files will remain installed in /root/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/oniguruma-1.1.0 for inspection.
Results logged to /root/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/extensions/x86_64-linux/2.3.0-static/oniguruma-1.1.0/gem_make.out  

我试过to compile my own oniguruma.但它失败了。如何在Ruby 2.3.1rails 4.2.6中安装oniguruma 1.1.0?

编辑:
我知道oniguruma是Ruby 1.9.x的标准。它是Ruby 2.3.x中的标准吗?如果没有,那么如何安装oniguruma的兼容版本?

0 个答案:

没有答案