google-cloud-ruby: Doesn't work on JRuby

Hi

Trying to upgrade my Logstash input https://github.com/Wondermall/logstash-input-google-cloud-pubsub But gcloud-ruby’s dependency on google-protobuf is causing it to trigger a native extensions build which is not supported by JRuby, making gcloud-ruby unusable for JRuby based environments which is a shame because it could be tremendously useful for Logstash.

I’ve tried JRUBY_OPTS="--2.0 -Xcext.enabled=true" but no dice, even though google-protobuf does check the RUBY_PLATFORM and it looks to me it shouldn’t be running the native extensions build but I’m no expert in gem building.

Building native extensions.  This could take a while...
ERROR:  Error installing gcloud:
    ERROR: Failed to build gem native extension.

    /opt/logstash/vendor/jruby/bin/jruby -r ./siteconf20160524-809-1vt2zkd.rb extconf.rb
NotImplementedError: C extension support is not enabled. Pass -Xcext.enabled=true to JRuby or set JRUBY_OPTS.

   (root) at /opt/logstash/vendor/jruby/lib/ruby/shared/mkmf.rb:8
  require at org/jruby/RubyKernel.java:1040
   (root) at /opt/logstash/vendor/jruby/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:1
   (root) at extconf.rb:3

extconf failed, uncaught signal 1

Gem files will remain installed in /opt/logstash/vendor/bundle/jruby/1.9/gems/google-protobuf-3.0.0.alpha.5.0.5.1 for inspection.
Results logged to /opt/logstash/vendor/bundle/jruby/1.9/extensions/universal-java-1.8/1.9/google-protobuf-3.0.0.alpha.5.0.5.1/gem_make.out

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 28 (13 by maintainers)

Commits related to this issue

Most upvoted comments

@pchaganti The grpc and google-protobuf gems are needed for services that connect using gRPC. However, BigQuery does not use gRPC and instead uses the JSON endpoints. So, instead of installing the google-cloud gem which contains all services, try just installing the google-cloud-bigquery gem which will only connect to BigQuery.