Build problems with 'bundle install'

1,262 views
Skip to first unread message

Joseph Palermo

unread,
Nov 17, 2012, 6:19:54 AM11/17/12
to choru...@googlegroups.com


The following was originally posted by gnilrets as a github issue

I'm moving the discussion here so others can more easily find it.

--------------------------------------------------------------------


Hi, I'm still having problems with the 'build install' step (is this the right place to post these kinds of problems? If not, please show me where).

BTW, I'm on a Mac with the lastest Mountain Lion.

[- chorus -] bundle install Fetching gem metadata from http://rubygems.org/....... Fetching gem metadata fromhttp://rubygems.org/..
Enter your password to install the bundled RubyGems to your system:
Using rake (10.0.0)
Using Platform (0.4.0)
Using open4 (1.3.0)
Using POpen4 (0.1.4)
Using i18n (0.6.1)
Using multi_json (1.3.7)
Using activesupport (3.2.9.rc2)
Using builder (3.0.4)
Using activemodel (3.2.9.rc2)
Using erubis (2.7.0)
Using journey (1.0.4)
Using rack (1.4.1)
Using rack-cache (1.2)
Using rack-test (0.6.2)
Using hike (1.2.1)
Using tilt (1.3.3)
Using sprockets (2.8.1)
Using actionpack (3.2.9.rc2)
Using mime-types (1.19)Using polyglot (0.3.3)
Using treetop (1.4.12)
Using mail (2.4.4)
Using actionmailer (3.2.9.rc2)Using arel (3.0.2)
Using tzinfo (0.3.35)Using activerecord (3.2.9.rc2)
Using activerecord-jdbc-adapter (1.2.2.chorus) from git://github.com/GreenplumCh
orus/activerecord-jdbc-adapter.git (at dynamic-schema-search-path)
Using jdbc-postgres (9.0.801)Using activerecord-jdbcpostgresql-adapter (1.2.2.chorus) from git://github.com/G
reenplumChorus/activerecord-jdbc-adapter.git (at dynamic-schema-search-path)Using activeresource (3.2.9.rc2)
Using addressable (2.3.2)Using allowy (0.2.6)
Using encryptor (1.1.3)
Using attr_encrypted (1.2.1)
Using bouncy-castle-java (1.5.0146.1)
Using nokogiri (1.5.5)
Using ffi (1.1.5)
Using childprocess (0.3.6)
Using libwebsocket (0.1.5)
Using rubyzip (0.9.9)
Using selenium-webdriver (2.26.0)
Using xpath (0.1.4)
Using capybara (1.1.3)
Using capybara-screenshot (0.3)
Using choice (0.1.6)
Using chorusgnip (0.0.1) from git://github.com/GreenplumChorus/gnip.git (at master)
Using chunky_png (1.2.6)
Using ci_reporter (1.7.3) from git://github.com/pivotal-leopold/ci_reporter.git (at master)

ci_reporter at /Users/gnilrets/.bundler/jruby/1.9/ci_reporter-3ec35b81c0d3 did not have a valid gemspec.
This prevents bundler from installing bins or native extensions, but that may not affect its functionality.
The validation message from Rubygems was:
[".gemtest"] are not files

Using clockwork (0.4.1)
Using cocaine (0.2.1)
Using columnize (0.3.6)
Using fssm (0.2.9)
Using sass (3.2.3)
Using compass (0.12.2)
Using compass-rails (1.0.3)
Using crack (0.3.1)
Using database_cleaner (0.9.1)
Using diff-lcs (1.1.3)
Using execjs (1.4.0)
Using factory_girl (4.1.0)
Using fakefs (0.4.0)
Using faker (1.1.2)
Using fakeweb (1.3.0)
Using fixture_builder (0.3.4)
Installing posix-spawn (0.3.6) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /opt/local/share/java/jruby/bin/jruby extconf.rb 

/opt/local/share/java/jruby/lib/ruby/shared/mkmf.rb:14: Use RbConfig instead of obsolete and deprecated Config.
mkmf.rb can't find header files for ruby at /opt/local/share/java/jruby/lib/native/include/ruby/ruby.h

Gem files will remain installed in /Users/gnilrets/.bundler/tmp/2669/gems/posix-spawn-0.3.6 for inspection.
Results logged to /Users/gnilrets/.bundler/tmp/2669/gems/posix-spawn-0.3.6/ext/gem_make.out
An error occurred while installing posix-spawn (0.3.6), and Bundler cannot continue.
Make sure that gem install posix-spawn -v '0.3.6' succeeds before bundling.

I then tried gem install posix-spawn, but got another error:

[- chorus -] sudo gem install posix-spawn -v '0.3.6'
Password:
Building native extensions. This could take a while...
ERROR: Error installing posix-spawn:
ERROR: Failed to build gem native extension.

    /opt/local/share/java/jruby/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.

(root) at /opt/local/share/java/jruby/lib/ruby/shared/mkmf.rb:8
require at org/jruby/RubyKernel.java:1019
(root) at /opt/local/share/java/jruby/lib/ruby/shared/rubygems/custom_require.rb:1
(root) at extconf.rb:1

Gem files will remain installed in /opt/local/share/java/jruby/lib/ruby/gems/shared/gems/posix-spawn-0.3.6 for inspection.
Results logged to /opt/local/share/java/jruby/lib/ruby/gems/shared/gems/posix-spawn-0.3.6/ext/gem_make.out

So it's complaining about not having the -Xcext.enabled=true set in JRUBY_OPTS, but it's definitely there:

[- chorus -] echo $JRUBY_OPTS
-X+O --client -Xcext.enabled=true -J-Xmx1024m -J-Xms512m -J-Xmn128m -J-XX:MaxPermSize=128m -J-Djava.library.path=./vendor/hadoop/lib/

Joseph Palermo

unread,
Nov 17, 2012, 6:25:42 AM11/17/12
to choru...@googlegroups.com
This is likely a problem with sudo.  Sudo only copies certain environment variables before it runs under elevated privileges.  If you do "sudo echo $JRUBY_OPTS" you probably won't see anything back.

Try specifying the environment variable as part of the command:
sudo JRUBY_OPTS="-X+O --client -J-Xmx2048m -J-Xms512m -J-Xmn128m -J-XX:MaxPermSize=128m -Xcext.enabled=true -J-Djava.library.path=./vendor/hadoop/lib/" gem install posix-spawn -v '0.3.6'

It will probably still fail, but it should give you a more accurate error now.

-Joseph

Sterling Paramore

unread,
Nov 19, 2012, 4:41:05 PM11/19/12
to choru...@googlegroups.com
Here's java-version,

[- chorus -] java -version
java version "1.6.0_37"
Java(TM) SE Runtime Environment (build 1.6.0_37-b06-434-11M3909)
Java HotSpot(TM) 64-Bit Server VM (build 20.12-b01-434, mixed mode)

And here's the make log.

[- chorus -] cat
/opt/local/share/java/jruby/lib/ruby/gems/shared/gems/posix-spawn-0.3.6/ext/gem_make.out
/opt/local/share/java/jruby/bin/jruby extconf.rb
/opt/local/share/java/jruby/lib/ruby/shared/mkmf.rb:14: Use RbConfig
instead of obsolete and deprecated Config.
mkmf.rb can't find header files for ruby at
/opt/local/share/java/jruby/lib/native/include/ruby/ruby.h



The directory /opt/local/share/java/jruby/lib/native/include does not
exist. Does that mean something went wrong with my ruby install?



On Mon, Nov 19, 2012 at 9:29 AM, Joseph Palermo
<jpal...@pivotallabs.com> wrote:
> Sorry, I guess "sudo echo $JRUBY_OPTS" doesn't behave as I thought it would.
> It interpolates the $JRUBY_OPTS before calling sudo.
>
> "sudo env" should show you if that environment variable is set using sudo or
> not.
>
> From the results though, it looks like something else is going on too.
>
> Can you tell us what "java -version" returns?
>
> Is there anything interesting in
> /opt/local/share/java/jruby/lib/ruby/gems/shared/gems/posix-spawn-0.3.6/ext/gem_make.out
>
>
> On Saturday, November 17, 2012 6:23:27 PM UTC-8, Sterling wrote:
>>
>> Hi Joseph. The sudo options were being set correctly, but even when
>> they're explicit, I still get the same error:'
>>
>> [- chorus -] sudo echo $JRUBY_OPTS
>> -X+O --client -Xcext.enabled=true -J-Xmx1024m -J-Xms512m -J-Xmn128m
>> -J-XX:MaxPermSize=128m -J-Djava.library.path=./vendor/hadoop/lib/
>> [- chorus -]
>>
>>
>> [- chorus -] sudo JRUBY_OPTS="-X+O --client -J-Xmx2048m -J-Xms512m
>> -J-Xmn128m -J-XX:MaxPermSize=128m -Xcext.enabled=true
>> -J-Djava.library.path=./vendor/hadoop/lib/" gem install posix-spawn -v
>> '0.3.6'
>> Building native extensions. This could take a while...
>> ERROR: Error installing posix-spawn:
>> ERROR: Failed to build gem native extension.
>>
>> /opt/local/share/java/jruby/bin/jruby extconf.rb
>> /opt/local/share/java/jruby/lib/ruby/shared/mkmf.rb:14: Use RbConfig
>> instead of obsolete and deprecated Config.
>> mkmf.rb can't find header files for ruby at
>> /opt/local/share/java/jruby/lib/native/include/ruby/ruby.h
>>
>>
>> Gem files will remain installed in

Joseph Palermo

unread,
Nov 19, 2012, 6:10:38 PM11/19/12
to choru...@googlegroups.com
Yes, there should be a lib/native/include/ruby/ruby.h somewhere.

I'm not sure if it is looking in the wrong spot, or if you are actually missing it somehow.

How did you install JRuby?

Sterling Paramore

unread,
Nov 19, 2012, 7:31:10 PM11/19/12
to choru...@googlegroups.com
I installed it using macports. Although I just went back to the page
referred to in the chorus wiki and it recommended not using a package
manager. I'll try reinstalling it and starting over.
> --
> You received this message because you are subscribed to the Google Groups
> "chorus-dev" group.
> To unsubscribe from this group, send email to
> chorus-dev+...@googlegroups.com.
>
>

Joseph Palermo

unread,
Nov 19, 2012, 7:52:16 PM11/19/12
to choru...@googlegroups.com
It does look like a bug with the macport of JRuby.  We just installed it and got the same error.

Searching the file system didn't come up with any copies of ruby.h.

Sterling

unread,
Dec 5, 2012, 12:30:09 AM12/5/12
to choru...@googlegroups.com
Finally got around to looking at this again.  I installed jruby binary for os x, but I'm still getting the same error.  

I don't see ruby.h in the jruby directories that I downloaded for os x.

Also, are there perhaps any binaries of open chorus for OS X or linux that I could just use, rather than building it from source?

Thanks,
Sterling

Lee, Logan

unread,
Dec 5, 2012, 12:52:49 AM12/5/12
to choru...@googlegroups.com
We will release binary version 2.2 of Chorus to customers this week. 

If we don't see major issues during the next couple of weeks, we will post it as the new trial version for anyone to download.  

Do you prefer to wait for that?  If not, we can post something privately for you to access sooner. 

Sterling Paramore

unread,
Dec 5, 2012, 8:58:46 AM12/5/12
to choru...@googlegroups.com
But isn't that just the trial commercial version?  Will there ever be a binary for the open source version?

Lee, Logan

unread,
Dec 5, 2012, 6:35:03 PM12/5/12
to choru...@googlegroups.com
There is only one version, built on the open source. We didn't hold anything back as a commercial version.   

Joseph Palermo

unread,
Dec 5, 2012, 6:51:00 PM12/5/12
to choru...@googlegroups.com
If you are still interested in getting the development environment up and running let us know.  We were able to get a computer into the same state as you are in.

It would seem that after MacPorts has been installed it leaves your ruby environment in a broken state.  This causes it to look for the headers in: 
/opt/local/share/java/jruby/lib/native/include/ruby/

rather than in:
/Library/Frameworks/JRuby.framework/Versions/1.7.0/lib/native/include/ruby/
where they probably actually are.

The easiest way to get it working would probably be to use rbenv: https://github.com/sstephenson/rbenv

But if you want help repairing your system ruby environment let us know.

apurva mayank

unread,
Feb 13, 2013, 2:39:07 AM2/13/13
to choru...@googlegroups.com
Hi Joseph,

The above may occur because of missing mkmf package, for ruby version 1.9 install 'ruby1.9.1-dev' mkmf package. 
Reply all
Reply to author
Forward
0 new messages