Автор Тема: Не устанавливаются и не обновляются гемы ruby  (Прочитано 5807 раз)

Оффлайн hasculdr

  • Завсегдатай
  • *
  • Сообщений: 672
Пробую установить гем pg, получаю
Цитировать
# gem install pg
Building native extensions. This could take a while...
ERROR:  Error installing pg:
   ERROR: Failed to build gem native extension.

    current directory: /usr/lib/ruby/gems/2.5.0/gems/pg-1.0.0/ext
/usr/bin/ruby -r ./siteconf20180717-1114-16375qg.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in /usr/lib/ruby/gems/2.5.0/gems/pg-1.0.0 for inspection.
Results logged to /usr/lib/ruby/gems/2.5.0/extensions/x86_64-linux/2.5.0/pg-1.0.0/gem_make.out
# rpm -qa | grep ruby
ruby-prof-0.16.2-alt1.M80P.4
ruby-tzinfo-0.3.25-alt1.1
ruby-2.5.1-alt0.M80P.1
ruby-stdlibs-2.5.1-alt0.M80P.1
ruby-tools-2.5.1-alt0.M80P.1
ruby-memcache-client-1.7.4-alt1.1
ruby-gem_plugin-doc-0.2.3-alt2.2
ruby-nokogiri-1.8.0-alt0.M80P.3
ruby-i18n-0.3.7-alt2.2
libruby-2.5.1-alt0.M80P.1
ruby-gem_plugin-0.2.3-alt2.2
libxml-ruby-3.0.0-alt0.M80P.4
Не совпадают версии. Очень скромно в этом соображаю, это ruby-gem в альтах не обновлен до соответствующего ruby-2.5.1? И есть ли ruby-2.5.1-dev пакет?

Оффлайн Skull

  • Глобальный модератор
  • *****
  • Сообщений: 19 908
    • Домашняя страница
    • Email
Для сборки gem c extension нужно установить компилятор и libruby-devel
Андрей Черепанов (cas@)

Оффлайн Skull

  • Глобальный модератор
  • *****
  • Сообщений: 19 908
    • Домашняя страница
    • Email
А чем не удовлетворяет ruby-pg из репозитория?
Андрей Черепанов (cas@)

Оффлайн hasculdr

  • Завсегдатай
  • *
  • Сообщений: 672
Для сборки gem c extension нужно установить компилятор и libruby-devel
libruby-devel поставил, теперь установка прерывается в другом месте. Как называется компилятор?

А чем не удовлетворяет ruby-pg из репозитория?
Да-да, утром вспомнил что в Альте некоторые гемы опакечены и поставил из репозитория. Работает.

Оффлайн Skull

  • Глобальный модератор
  • *****
  • Сообщений: 19 908
    • Домашняя страница
    • Email
Компилятор по умолчанию для p8 – gcc5.
Андрей Черепанов (cas@)

Оффлайн hasculdr

  • Завсегдатай
  • *
  • Сообщений: 672
Не могу установить gem rails:
# gem install rails
# gem install rails
Building native extensions. This could take a while...
ERROR:  Error installing rails:
ERROR: Failed to build gem native extension.

    current directory: /usr/lib/ruby/gems/2.5.0/gems/nokogiri-1.10.1/ext/nokogiri
/usr/bin/ruby -I /usr/lib/ruby/site_ruby -r ./siteconf20190226-19788-bh955l.rb extconf.rb
checking if the C compiler accepts ... yes
Building nokogiri using packaged libraries.
Using mini_portile version 2.4.0
checking for gzdopen() in -lz... no
zlib is missing; necessary for building libxml2
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib64
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/$(RUBY_BASE_NAME)
--help
--clean
--use-system-libraries
--enable-static
--disable-static
--with-zlib-dir
--without-zlib-dir
--with-zlib-include
--without-zlib-include=${zlib-dir}/include
--with-zlib-lib
--without-zlib-lib=${zlib-dir}/lib64
--enable-cross-build
--disable-cross-build

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /usr/lib/ruby/gems/2.5.0/extensions/x86_64-linux/2.5.0/nokogiri-1.10.1/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /usr/lib/ruby/gems/2.5.0/gems/nokogiri-1.10.1 for inspection.
Results logged to /usr/lib/ruby/gems/2.5.0/extensions/x86_64-linux/2.5.0/nokogiri-1.10.1/gem_make.out
cat mkmf.log
# cat /usr/lib/ruby/gems/2.5.0/extensions/x86_64-linux/2.5.0/nokogiri-1.10.1/mkmf.log
"x86_64-alt-linux-gcc -o conftest -I/usr/include/x86_64-linux -I/usr/include/ruby/backward -I/usr/include -I.    -pipe -Wall -g -O2 -fPIC  conftest.c  -L. -L/usr/lib64 -L. -fstack-protector -rdynamic -Wl,-export-dynamic     -lruby  -lpthread -ldl -lcrypt -lm   -lc "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

"x86_64-alt-linux-gcc -I/usr/include/x86_64-linux -I/usr/include/ruby/backward -I/usr/include -I.    -pipe -Wall -g -O2 -fPIC    -Werror -c conftest.c"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main() {return 0;}
/* end */

have_library: checking for gzdopen() in -lz... -------------------- no

"x86_64-alt-linux-gcc -o conftest -I/usr/include/x86_64-linux -I/usr/include/ruby/backward -I/usr/include -I.    -pipe -Wall -g -O2 -fPIC  -g -DXP_UNIX -Wall -Wcast-qual -Wwrite-strings -Wmissing-noreturn -Winline conftest.c  -L. -L/usr/lib64 -L. -fstack-protector -rdynamic -Wl,-export-dynamic     -lruby -lz  -lpthread -ldl -lcrypt -lm   -lc "
conftest.c:3:18: fatal error: zlib.h: Нет такого файла или каталога
compilation terminated.
checked program was:
/* begin */
 1: #include "ruby.h"
 2:
 3: #include <zlib.h>
 4:
 5: /*top*/
 6: extern int t(void);
 7: int main(int argc, char **argv)
 8: {
 9:   if (argc > 1000000) {
10:     printf("%p", &t);
11:   }
12:
13:   return 0;
14: }
15: int t(void) { void ((*volatile p)()); p = (void ((*)()))gzdopen; return !p; }
/* end */

"x86_64-alt-linux-gcc -o conftest -I/usr/include/x86_64-linux -I/usr/include/ruby/backward -I/usr/include -I.    -pipe -Wall -g -O2 -fPIC  -g -DXP_UNIX -Wall -Wcast-qual -Wwrite-strings -Wmissing-noreturn -Winline conftest.c  -L. -L/usr/lib64 -L. -fstack-protector -rdynamic -Wl,-export-dynamic     -lruby -lz  -lpthread -ldl -lcrypt -lm   -lc "
conftest.c:3:18: fatal error: zlib.h: Нет такого файла или каталога
compilation terminated.
checked program was:
/* begin */
 1: #include "ruby.h"
 2:
 3: #include <zlib.h>
 4:
 5: /*top*/
 6: extern int t(void);
 7: int main(int argc, char **argv)
 8: {
 9:   if (argc > 1000000) {
10:     printf("%p", &t);
11:   }
12:
13:   return 0;
14: }
15: extern void gzdopen();
16: int t(void) { gzdopen(); return 0; }
/* end */

--------------------
гем опакечен в p7 и sisyphus - про p8 забыли, или есть сложности?

Оффлайн Skull

  • Глобальный модератор
  • *****
  • Сообщений: 19 908
    • Домашняя страница
    • Email
ruby-rails нормально опакечен в Sisyphus. Из p8 его выкинули и сделали уже а Sisyphus нормально: почти все пакеты – gems.
Андрей Черепанов (cas@)