sup-heliotrope / sup

A curses threads-with-tags style email client (mailing list: supmua@googlegroups.com)
http://sup-heliotrope.github.io
GNU General Public License v2.0
900 stars 97 forks source link

Write permissions to gems #529

Closed lpvm closed 4 years ago

lpvm commented 7 years ago

Hi,

I'm not a ruby programmer, so I don't know what exactly should be done. When doing:

$ gem install sup
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /usr/lib/ruby/gems/2.3.0 directory.

Should I modify the user, group or permissions of that directory so that my user can be able to write to there? Is this what's supposed to be? Normally, a /usr dir is not writable by users.

terotil commented 7 years ago

lpvm, 2017-01-05 19:37:

I'm not a ruby programmer, so I don't know what exactly should be done. When doing:

$ gem install sup
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /usr/lib/ruby/gems/2.3.0 directory.

Should I modify the user, group or permissions of that directory so that my user can be able to write to there?

No. It is usually best to leave that directory tree (/usr/lib) for your distribution package manager to handle.

Try to install under you home directory

$ gem install --user-install sup

See http://guides.rubygems.org/faqs/#user-install for more info.

lpvm commented 7 years ago

Hi, For years, I've been curious to try sup, but never managed to install it, first on Slackware Linux, now on Void Linux. I tried to install it as it's mentioned in the home page of http://supmua.org, using an underprivileged prompt:

$ gem install sup
$ sup-config

Ok. After trying $ gem install --user-install sup

I got a problem with the PATH

WARNING:  You don't have /home/lupe/.gem/ruby/2.3.0/bin in your PATH,
      gem executables will not run.
Building native extensions.  This could take a while...
ERROR:  Error installing sup:
    ERROR: Failed to build gem native extension.

corrected the issue and tried again:

PATH=$PATH:/home/lupe/.gem/ruby/2.3.0/bin
$ gem install --user-install sup

ERROR:  Error installing sup:
    ERROR: Failed to build gem native extension.
    current directory: /wd0data/home/lupe/.gem/ruby/2.3.0/gems/ncursesw-1.4.10
/usr/bin/ruby -r ./siteconf20170106-10666-16heycy.rb extconf.rb
/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- mkmf (LoadError)
    from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from extconf.rb:24:in `<main>'
extconf failed, exit code 1

What's wrong now? Is this only occurring with me?

terotil commented 7 years ago

lpvm, 2017-01-06 17:56:

corrected the issue and tried again:

PATH=$PATH:/home/lupe/.gem/ruby/2.3.0/bin
$ gem install --user-install sup

ERROR:  Error installing sup:
    ERROR: Failed to build gem native extension.
    current directory: /wd0data/home/lupe/.gem/ruby/2.3.0/gems/ncursesw-1.4.10
/usr/bin/ruby -r ./siteconf20170106-10666-16heycy.rb extconf.rb
/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- mkmf (LoadError)
    from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from extconf.rb:24:in `<main>'
extconf failed, exit code 1

What's wrong now?

To compile native extensions you need ruby dev tools and c(++) compiler. In Debian derivatives you get them by installing packages ruby-dev and build-essentials. Unfortunately I've got no idea how this translates to your distribution.

Is this only occurring with me?

No. Just search for "mkmf LoadError" and you'll get quite a few results.

lpvm commented 7 years ago

Hi Tero,

Now the error is different:

$ gem install --user-install sup
Building native extensions.  This could take a while...
ERROR:  Error installing sup:
    ERROR: Failed to build gem native extension.

    current directory: /wd0data/home/lupe/.gem/ruby/2.3.0/gems/sup-0.22.1/ext
/usr/bin/ruby mkrf_conf_xapian.rb
xapian: installing xapian-ruby..
xapian: platform specific dependencies.

I've installed all the packages that I can think of that may be useful:

 gcc-6.3.0_2                        The GNU C Compiler
 gcc-c++-4.9.4_1                    The GNU C Compiler - C++ support
 libgcc-6.3.0_2                     The GNU C Compiler - GCC library
 libgcc-devel-6.3.0_2               The GNU C Compiler - GCC library - development files
 ruby-2.3.3_1                       Ruby programming language
 ruby-devel-2.3.3_1                 Ruby programming language - development files
 cmake-3.7.1_1                      Cross-platform, open-source build system
 make-4.2.1_2                       The GNU make system
 libxapian-1.4.2_1                  Open source search engine - runtime library
 xapian-core-1.4.2_1                Open source search engine
 xapian-core-devel-1.4.2_1          Open source search engine - development files
 ruby-2.3.3_1                       Ruby programming language
 ruby-devel-2.3.3_1                 Ruby programming language - development files

Do you suggest any other package? Anything else?
terotil commented 7 years ago

Error that caused Xapian install to fail is missing. Find any gem_make.out (extension build logs) files under ~/.gem/? They might contain hints as to what went wrong.

lpvm commented 7 years ago

The gem_make.out file didn't contain anything more than what was shown as error on the screen, so I went for: $ gem install --user-install sup --debug --backtrace --verbose &> sup_error.log

The result is in http://pasted.co/735df560

terotil commented 7 years ago

Somehow there's no trace of the error which prevents xapian-sup from being installed. Could you try installing xapian-sup directly?

$ gem install --user-install xapian-sup --debug --backtrace --verbose

lpvm commented 7 years ago

Here's what I got:

NOTE:  Debugging mode prints all exceptions even when rescued
Exception `LoadError' at /usr/lib/ruby/2.3.0/resolv.rb:171 - LoadError
Exception `Gem::UnsatisfiableDependencyError' at /usr/lib/ruby/2.3.0/rubygems/resolver/installer_set.rb:71 - Unable to resolve dependency: user requested 'xapian-sup (>= 0)'
ERROR:  Could not find a valid gem 'xapian-sup' (>= 0) in any repository
Exception `Errno::EEXIST' at /usr/lib/ruby/2.3.0/fileutils.rb:253 - File exists @ dir_s_mkdir - /home/lupe/.gem/specs/api.rubygems.org%443
ERROR:  Possible alternatives: xapian-fu, xapian, xapian-full, xapian-ruby, xapian_db
HEAD https://api.rubygems.org/api/v1/dependencies
200 OK
GET https://api.rubygems.org/api/v1/dependencies?gems=xapian-sup
200 OK
GET https://api.rubygems.org/latest_specs.4.8.gz
200 OK
sup_error.log (END)
terotil commented 7 years ago

Argh! My bad. It should have been xapian-ruby of course, not xapian-sup. Sorry.

lpvm commented 7 years ago

Don't have to be sorry, I'm the one that is grateful for this kind help! xapian-ruby was a step ahead, but I see a strange log:


checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /sbin/sed
checking for grep that handles long lines and -e... /sbin/grep
checking for egrep... /sbin/grep -E
checking for fgrep... /sbin/grep -F
checking for ld used by gcc... /sbin/ld
checking if the linker (/sbin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /sbin/nm -B
checking the name lister (/sbin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /sbin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /sbin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /sbin/dd
checking how to truncate binary pipes... /sbin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/sbin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for g++... g++
checking whether we are using the GNU C++ compiler... no
checking whether g++ accepts -g... no
checking dependency style of g++... none
checking how to run the C++ preprocessor... /lib/cpp
checking whether the g++ linker (/sbin/ld -m elf_x86_64) supports shared libraries... yes
libtool.m4: error: problem compiling CXX test program
checking for g++ option to produce PIC...  -DPIC
checking if g++ PIC flag  -DPIC works... no
checking if g++ static flag  works... no
checking if g++ supports -c -o file.o... no
checking if g++ supports -c -o file.o... (cached) no
checking whether the g++ linker (/sbin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... unsupported
checking whether g++ is a working C++ compiler... no
configure: error: 
*** You need a working C++ compiler to compile Xapian, but configure failed to
*** find one.  If you have a working C++ compiler, you can tell configure where
*** to find it by invoking it like so:
***
***   ./configure CXX=/opt/bin/c++
rake aborted!

I have g++ available:

# whereis g++ 
g++: /usr/bin/g++ /usr/share/man/man1/g++.1

# g++ --version
g++ (GCC) 4.9.4

How to deal with this?

terotil commented 7 years ago

lpvm, 2017-01-11 01:02:

checking whether we are using the GNU C compiler... yes ... checking whether we are using the GNU C++ compiler... no

For some weird reason xapian extconf doesn't seem to see your g++. You could try prefixing your install command with CXX=/usr/bin/g++ and hope that whoever wrote that extconf decided to obey env variables and that not seeing your GNU C++ compiler was caused by not lookin from same PATH than your shell did.

If that doesn't help, I'd go ask xapian-ruby developers.

-- Tero Tilus ## 050 3635 235 ## http://tero.tilus.net/

JuPlutonic commented 4 years ago

Prepend your PATH with new gcc binaries If you system not privided gcc newer than 5.5, use one of followed gcc packages:

/usr/bin/g++ would be new path like /span/bin/g++ or /home/linuxbrew/.linuxbrew/bin/g++ in following command:

CXX=/usr/bin/g++ gem install xapian-ruby --version 1.4.9 && CXX=/usr/bin/g++ gem pristine xapian-ruby --version 1.4.9 && gem install sup
lpvm commented 4 years ago

Hi @JuPlutonic ,

This solved the issue. I'll be able to try sup now. Thanks!