0

I installed RandSQLGenerator on my Mac (Sierra) and ran this command.

./gentest.pl --dsn=dbi:mysql:host=127.0.0.1:port=4000:user=root:database=test --grammar=conf/outer_join.yy --gendata=conf/outer_join.zz --thread=1 --sqltrace=MarkErrors

I got the following error message

Can't locate GDBM_File.pm in @INC (you may need to install the GDBM_File module)
(@INC contains:
/lib
lib
/Library/Perl/5.18/darwin-thread-multi-2level
/Library/Perl/5.18
/Network/Library/Perl/5.18/darwin-thread-multi-2level
/Network/Library/Perl/5.18
/Library/Perl/Updates/5.18.2/darwin-thread-multi-2level
/Library/Perl/Updates/5.18.2
/System/Library/Perl/5.18/darwin-thread-multi-2level
/System/Library/Perl/5.18
/System/Library/Perl/Extras/5.18/darwin-thread-multi-2level
/System/Library/Perl/Extras/5.18
.
) at lib/GenTest.pm line 34.
BEGIN failed--compilation aborted at lib/GenTest.pm line 34.
Compilation failed in require at ./gentest.pl line 27.
BEGIN failed--compilation aborted at ./gentest.pl line 27.

I tried to search it from Google but still cannot solve this problem.

Borodin
  • 126,100
  • 9
  • 70
  • 144
XHY
  • 26
  • 1
  • GDBM_File is a core module as you can see [here](http://perlpunks.de/corelist/version?module=GDBM_File). Maybe it isn't included in the perl core under macOS. Check if you can find the module in another package. You cannot install it via CPAN, since it's only included in Perl. – tinita Feb 11 '18 at 16:48
  • If you're going to re-open, you need to update the question to state why it's more viable now. Formatting is almost never the reason – New Alexandria Feb 12 '18 at 03:18

1 Answers1

0

It's on cpan.

You can install it via this command:

cpan GDBM_File

amon
  • 57,091
  • 2
  • 89
  • 149
Ron Bergin
  • 1,070
  • 1
  • 6
  • 7
  • 1
    GDBM_File is a core module and cannot be installed without installing the perl it's included with. – tinita Feb 11 '18 at 16:49
  • @tinita: Some Linux distributions like to trim Perl core modules, presumably to save storage. For instance, see [this about ***RedHat***](https://bugzilla.redhat.com/show_bug.cgi?id=1110564). I can only imagine that it's intended for embedded systems or similar, but I can't find an instance of ther RedHat team giving either an explanation or a list of what has been cut out. – Borodin Feb 11 '18 at 17:11
  • @Borodin I know about RedHat/CentOS, you can install all core modules there with the additional package `perl-core`. But still, you can't use cpan to install those packages, only if they are dual-life modules that have their own distribution. For the issue here with macOS it seems there was a reason for excluding this module. – tinita Feb 11 '18 at 17:15
  • @tinita: I can only guess about this specific module, but even [`perl-core` does not contain all perl modules](https://bugzilla.redhat.com/show_bug.cgi?id=985791). The complaint there is only that `CGI` is missing, but it leaves the `perl-core` package questionable. – Borodin Feb 11 '18 at 17:22
  • Off topic, I'm wondering why `Text::CSV` is non-core. I can see that its reliance on both `Text::CSV_PP` and `Text::CSV_XS` may be an issue, but I'd rather not be guessing. – Borodin Feb 11 '18 at 17:29
  • @amon I can not install GDBM_File using `CPAN GDBM_File` > cpan GDBM_File CPAN: Storable loaded ok (v2.41) Reading '/Users/xuhuaiyu/.cpan/Metadata' Database was generated on Sun, 11 Feb 2018 17:29:02 GMT Running install for module 'GDBM_File' The most recent version "1.15" of the module "GDBM_File" is part of the perl-5.26.1 distribution. To install that, you need to run force install GDBM_File --or-- install S/SH/SHAY/perl-5.26.1.tar.bz2 Running make test Can't test without successful make Running make install Make had returned bad status, install seems impossible – XHY Feb 12 '18 at 04:13
  • Thanks for your help, I've solved this. I use `CPAN install S/SH/SHAY/perl-5.26.1.tar.bz2` and run `perl ./gentest.pl --dsn=dbi:mysql:host=127.0.0.1:port=4000:user=root:database=test --grammar=conf/outer_join.yy --gendata=conf/outer_join.zz --thread=1 --sqltrace=MarkErrors ` – XHY Feb 12 '18 at 05:15
  • And after `CPAN install S/SH/SHAY/perl-5.26.1.tar.bz2`, `perl -e 'print join("\n", @INC);'` outputs: `/usr/local/lib/perl5/5.26.1/darwin-2level /usr/local/lib/perl5/5.26.1 /usr/local/lib/perl5 /usr/local/lib/perl5/site_perl/5.26.1/darwin-2level /usr/local/lib/perl5/site_perl/5.26.1 /usr/local/lib/perl5/5.26.1/darwin-2level /usr/local/lib/perl5/5.26.1 /usr/local/lib/perl5/site_perl/5.18.2 /usr/local/lib/perl5/site_perl%` – XHY Feb 12 '18 at 05:18