lsegal/ripper18

The wily st.h (on Ubuntu and rvm)...

epitron opened this issue · 8 comments

Hi there!

This gem is a great idea. It could definitely come in handy backporting some Ruby1.9 libs.

Unfortunately, it doesn't build against Ubuntu and rvm's Ruby 1.8. I believe it's because of the location of the header files.

Ubuntu:
/usr/lib/ruby/1.8/i686-linux/st.h

rvm:
~/.rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/i686-linux/st.h

As you can see, similar locations. I don't know anything about ruby's build system, so I can't suggest a solution. I can tell you that I haven't had a problem with any other gems linking against ruby, so there's probably a standard solution to this.

Thanks!

Well, this might be a problem with the build setup. If mkmf works properly, it should be setting the include path to the correct prefix in either case. Can you provide more information about the failure? Your makefile? The failure log?

[12:21 AM] root@ix :: ~ # gem install ripper
Building native extensions. This could take a while...
ERROR: Error installing ripper:
ERROR: Failed to build gem native extension.

    /usr/bin/ruby1.8 extconf.rb

checking for bison... yes
creating Makefile

make
/usr/bin/ruby1.8 ./tools/preproc.rb parse.y --output=ripper.y
bison -t -v -oy.tab.c ripper.y
sed -f tools/ytab.sed -e "/^#/s!y.tab.c!ripper.c!" y.tab.c > ripper.c
/usr/bin/ruby1.8 ./tools/generate.rb --mode=eventids1 --ids1src=parse.y --output=eventids1.c
/usr/bin/ruby1.8 ./tools/generate.rb --mode=eventids2table --ids2src=./eventids2.c --output=eventids2table.c
gcc -I. -I/usr/lib/ruby/1.8/i486-linux -I/usr/lib/ruby/1.8/i486-linux -I. -I./backports -DRIPPER -D_FILE_OFFSET_BITS=64 -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -c ripper.c
ripper.y:19:21: error: ruby/st.h: No such file or directory
ripper.y:4906:24: error: ruby/regex.h: No such file or directory
ripper.y:4907:23: error: ruby/util.h: No such file or directory
make: *** [ripper.o] Error 1

Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/ripper-1.0.2 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/ripper-1.0.2/ext/gem_make.out

Can you find the st.h file for me in a Ubuntu install?

I just realized that I was building against debian squeeze's ruby1.8, not Ubuntu. Ripper does work on Ubuntu.

Debian's st.h is in:
/usr/lib/ruby/1.8/i486-linux/st.h

Any updates on this? I can't install this gem with rvm (ruby 1.8.7) in ubuntu 11.04

Thanks!

I've just merged some pull requests, if you checkout master (or update your local copy) does it fix?

Thank you. Your last commit solves the problem for me: Ubuntu 11.04, ruby 1.8.7, ree (ree-1.8.7-2011.03), rvm 1.5.2

Thanks, this fix is in 1.0.3