ondra-m / ruby-spark

Ruby wrapper for Apache Spark
MIT License
227 stars 29 forks source link

JRuby Gemfile: C Extension #10

Open emnl opened 9 years ago

emnl commented 9 years ago

Great project!

I am having trouble installing ruby-spark via bundle and JRuby. This is what happens:

=> bundle install
Fetching gem metadata from https://rubygems.org/........
Fetching version metadata from https://rubygems.org/..
Resolving dependencies......
Using coderay 1.1.0
Using highline 1.7.2
Using commander 4.3.4
Using diff-lcs 1.2.5
Using distribution 0.7.3
Using ffi 1.9.10
Using tins 0.13.2
Using file-tail 1.0.12
Using method_source 0.8.2
Using nio4r 1.1.0
Using slop 3.6.0
Using spoon 0.0.4
Using pry 0.10.1
Installing rjb 1.5.3 with native extensions

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

    /Users/emanuel/.rvm/rubies/jruby-1.7.20.1/bin/jruby -r ./siteconf20150702-1012-k7ach.rb extconf.rb
NotImplementedError: C extension support is not enabled. Pass -Xcext.enabled=true to JRuby or set JRUBY_OPTS.

   (root) at /Users/emanuel/.rvm/rubies/jruby-1.7.20.1/lib/ruby/shared/mkmf.rb:8
  require at org/jruby/RubyKernel.java:1072
   (root) at /Users/emanuel/.rvm/rubies/jruby-1.7.20.1/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:1
   (root) at extconf.rb:6

extconf failed, uncaught signal 1

Gem files will remain installed in /Users/emanuel/.rvm/gems/jruby-1.7.20.1@testing/gems/rjb-1.5.3 for inspection.
Results logged to /Users/emanuel/.rvm/gems/jruby-1.7.20.1@testing/extensions/universal-java-1.8/1.9/rjb-1.5.3/gem_make.out
An error occurred while installing rjb (1.5.3), and Bundler cannot continue.
Make sure that `gem install rjb -v '1.5.3'` succeeds before bundling.

=> ruby -v
jruby 1.7.20.1 (1.9.3p551) 2015-06-10 d7c8c27 on Java HotSpot(TM) 64-Bit Server VM 1.8.0_11-b12 +jit [darwin-x86_64]

=> java -version
java version "1.8.0_11"
Java(TM) SE Runtime Environment (build 1.8.0_11-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.11-b03, mixed mode)

=> cat .rvmrc
rvm --create use jruby-1.7.20.1@testing

The bundle worked when I removed the following lines from ruby-spark's Gemfile:

platform :mri do
  gem 'rjb'
  gem 'msgpack'
  gem 'oj'
  gem 'narray'
end

Strange, of course, as I am not even using MRI.

Any ideas?

emnl commented 9 years ago

Things are getting even stranger. If I clone ruby-spark and point my Gemfile to the local version of the gem, then everything works as expected:

=> bundle install
Fetching gem metadata from https://rubygems.org/..........
Fetching version metadata from https://rubygems.org/..
Resolving dependencies.............
Installing coderay 1.1.0
Installing highline 1.7.2
Installing commander 4.3.4
Installing distribution 0.7.3
Installing ffi 1.9.10 with native extensions
Installing tins 0.13.2
Installing file-tail 1.0.12
Installing method_source 0.8.2
Installing nio4r 1.1.0
Installing slop 3.6.0
Installing spoon 0.0.4
Installing pry 0.10.1
Installing sexp_processor 3.2.0
Installing ruby_parser 2.3.1
Installing ruby2ruby 1.3.1
Installing sourcify 0.6.0.rc4
Using ruby-spark 1.2.0 from source at /Users/emanuel/projects/ruby-spark
Using bundler 1.10.5
Bundle complete! 1 Gemfile dependency, 18 gems now installed.

Still no luck the with remote version however.

ondra-m commented 9 years ago

What do you mean by "I am having trouble installing ruby-spark via bundle and JRuby"?

Adding a gem 'ruby-spark' to Gemfile?

emnl commented 9 years ago

I mean that if I add gem 'ruby-spark' to my Gemfile and run the command above, then I get the output as shown above.

ondra-m commented 9 years ago

What about jruby 9000?

Jruby 1.x is not supported. (Only Ruby 2+).

emnl commented 9 years ago

Sadly, I get the exact same error using JRuby-9.0.0.0.rc1.

ondra-m commented 9 years ago

Its because rubygems.org contains only one java version (1.1.0.1). But it seems that this version not working. I'll try to fix it.