Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.jrubyrc file not supporting cext.enabled=true #953

Closed
jwoertink opened this issue Aug 13, 2013 · 4 comments
Closed

.jrubyrc file not supporting cext.enabled=true #953

jwoertink opened this issue Aug 13, 2013 · 4 comments
Assignees
Milestone

Comments

@jwoertink
Copy link

@jwoertink jwoertink commented Aug 13, 2013

My default JRuby uses 1.9.3 mode. I added a .jrubyrc file to my project containing

compat.version=2.0
cext.enabled=true

Then I was able to do ruby -v and see it was in 2.0.0 mode. This verified that the .jrubyrc file was being read. I tried to install the ox gem, and got

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /Users/jeremy/.rvm/rubies/jruby-1.7.4/bin/jruby extconf.rb 
NotImplementedError: C extension support is not enabled. Pass -Xcext.enabled=true to JRuby or set JRUBY_OPTS or modify .jrubyrc to enable.

I tried closing my terminal, and re-opening, but still got the error. After I did export JRUBY_OPTS=-Xcext.enabled=true I was able to bundle the gem. So it seems the .jrubyrc file just ignored that option.

My system:
jruby 1.7.4 (2.0.0) 2013-05-16 2390d3b on Java HotSpot(TM) 64-Bit Server VM 1.6.0_51-b11-457-11M4509 [darwin-x86_64]
OSX 10.8.4

@ghost ghost assigned BanzaiMan Aug 15, 2013
@BanzaiMan BanzaiMan closed this in f1a63bf Aug 15, 2013
@BanzaiMan
Copy link
Member

@BanzaiMan BanzaiMan commented Aug 15, 2013

The problem with the .jrubyrc approach is that, during gem installation, you would be in the fetched source's directory, not where you invoke jruby -S gem (or equivalent).

.jrubyrc does set the value correctly, but it just won't take effect when you want it.

$ cat > .jrubyrc                                
cext.enabled=true
$ jruby -v -e 'puts ENV_JAVA["jruby.cext.enabled"]'
jruby 1.7.5.dev (1.9.3p392) 2013-08-15 25edb17 on Java HotSpot(TM) 64-Bit Server VM 1.7.0_25-b15 [darwin-x86_64]
true
@jwoertink
Copy link
Author

@jwoertink jwoertink commented Aug 15, 2013

ah, ok. So really it only would work if that .jrubyrc was in my home directory, or something a bit more global as opposed to the project directory. Thanks!

@rbotafogo
Copy link

@rbotafogo rbotafogo commented Mar 31, 2015

This is an old thread, but I´m having trouble with .jrubyrc. I´ve put it in my home directory and it doesn´t seem to change anything. I actually want to change the java heap size.

Thanks

@headius
Copy link
Member

@headius headius commented Apr 6, 2015

@rbotafogo Please open a new issue if you're having problems with .jrubyrc on a current version of JRuby.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants