ruby / stringio

Pseudo `IO` class from/to `String`.
BSD 2-Clause "Simplified" License
33 stars 26 forks source link

Fails to install on Ubuntu 18.04 wit ruby 2.5 #3

Closed bendikro closed 6 years ago

bendikro commented 6 years ago
sudo gem install stringio
Building native extensions. This could take a while...
ERROR:  Error installing stringio:
    ERROR: Failed to build gem native extension.

    current directory: /var/lib/gems/2.5.0/gems/stringio-0.0.1
/usr/bin/ruby2.5 -r ./siteconf20180424-25285-1aa9ae4.rb extconf.rb
creating Makefile

current directory: /var/lib/gems/2.5.0/gems/stringio-0.0.1
make "DESTDIR=" clean

current directory: /var/lib/gems/2.5.0/gems/stringio-0.0.1
make "DESTDIR="
make: *** No rule to make target '/include/ruby.h', needed by 'stringio.o'.  Stop.

make failed, exit code 2

Gem files will remain installed in /var/lib/gems/2.5.0/gems/stringio-0.0.1 for inspection.
Results logged to /var/lib/gems/2.5.0/extensions/x86_64-linux/2.5.0/stringio-0.0.1/gem_make.out
hsbt commented 6 years ago

Did you install ruby-dev package with ubuntu?

bendikro commented 6 years ago

Yes, ruby-dev is installed.

bendikro commented 6 years ago

The content of the depend file in the build dir (/var/lib/gems/2.5.0/gems/stringio-0.0.1) is:

# AUTOGENERATED DEPENDENCIES START
stringio.o: $(RUBY_EXTCONF_H)
stringio.o: $(arch_hdrdir)/ruby/config.h
stringio.o: $(hdrdir)/ruby/backward.h
stringio.o: $(hdrdir)/ruby/defines.h
stringio.o: $(hdrdir)/ruby/encoding.h
stringio.o: $(hdrdir)/ruby/intern.h
stringio.o: $(hdrdir)/ruby/io.h
stringio.o: $(hdrdir)/ruby/missing.h
stringio.o: $(hdrdir)/ruby/onigmo.h
stringio.o: $(hdrdir)/ruby/oniguruma.h
stringio.o: $(hdrdir)/ruby/ruby.h
stringio.o: $(hdrdir)/ruby/st.h
stringio.o: $(hdrdir)/ruby/subst.h
stringio.o: $(top_srcdir)/include/ruby.h
stringio.o: stringio.c
# AUTOGENERATED DEPENDENCIES END

The depend file is appended to the Makefile, and the problem is that the _topsrcdir variable is undefined and therefore empty when substituted, leading to the error: No rule to make target '/include/ruby.h', needed by 'stringio.o'

vanboom commented 6 years ago

Installing ruby-dev fixed this for me.

fmoudoute commented 5 years ago

I have the same issue. I am on Mac, and the website works all fine on localhost. How do I install the "ruby-dev" please ? Sorry - newbie question

w9ahmed commented 5 years ago

Try install sudo apt install zlib1g-dev as well.