#前提・実現したいこと
KH Coderをmacにインストールしようとしており、Perlの追加モジュールを入れていたところこけまくった挙句解決できませんでした。
インストール方法については以下のサイトを参考にしております。
KH CoderをMacにインストール
Perlに触るのも初めてですが、なんせ知識の乏しいmake周りでこけているようでご教授いただきたいです。
#発生している問題
KH Corderを起動しようとすると以下のように表示されるため該当モジュールの追加を試みました
bash
$ perl kh_coder.pl Perl/Tk: 804.034 Can't locate DBD/mysql.pm in @INC (you may need to install the DBD::mysql module) (@INC contains: /Users/hoge/Documents/kh_coder/kh_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 /Users/hoge/Documents/kh_coder/kh_lib/kh_projects.pm line 6. BEGIN failed--compilation aborted at /Users/hoge/Documents/kh_coder/kh_lib/kh_projects.pm line 6. Compilation failed in require at kh_coder.pl line 129. BEGIN failed--compilation aborted at kh_coder.pl line 129.
※ユーザー名は一応伏せました。
DBD/mysqlが足りないのでcpanによるインストールを試みた結果が以下の通りです。
Perl
cpan[1]> install DBD::mysql Reading '/var/root/.cpan/Metadata' Database was generated on Mon, 16 Apr 2018 00:54:25 GMT Running install for module 'DBD::mysql' Running make for C/CA/CAPTTOFU/DBD-mysql-4.046.tar.gz Checksum for /var/root/.cpan/sources/authors/id/C/CA/CAPTTOFU/DBD-mysql-4.046.tar.gz ok Scanning cache /var/root/.cpan/build for sizes ............................................................................DONE CPAN.pm: Building C/CA/CAPTTOFU/DBD-mysql-4.046.tar.gz PLEASE NOTE: For 'make test' to run properly, you must ensure that the database user 'root' can connect to your MySQL server and has the proper privileges that these tests require such as 'drop table', 'create table', 'drop procedure', 'create procedure' as well as others. mysql> grant all privileges on test.* to 'root'@'localhost' identified by 's3kr1t'; You can also optionally set the user to run 'make test' with: perl Makefile.PL --testuser=username I will use the following settings for compiling and testing: cflags (mysql_config) = -I/usr/local/Cellar/mysql/5.7.21/include/mysql embedded (mysql_config) = ldflags (guessed ) = libs (mysql_config) = -L/usr/local/Cellar/mysql/5.7.21/lib -lmysqlclient -lssl -lcrypto mysql_config (guessed ) = mysql_config nocatchstderr (default ) = 0 nofoundrows (default ) = 0 nossl (default ) = 0 testdb (default ) = test testhost (default ) = testpassword (default ) = testport (default ) = testsocket (default ) = testuser (guessed ) = root To change these settings, see 'perl Makefile.PL --help' and 'perldoc DBD::mysql::INSTALL'. Checking if your kit is complete... Looks good Using DBI 1.631 (for perl 5.018002 on darwin-thread-multi-2level) installed in /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level/auto/DBI/ Writing Makefile for DBD::mysql Wide character in print at /System/Library/Perl/5.18/ExtUtils/MakeMaker.pm line 1034. Wide character in print at /System/Library/Perl/5.18/ExtUtils/MakeMaker.pm line 1034. Writing MYMETA.yml and MYMETA.json cp lib/DBD/mysql/GetInfo.pm blib/lib/DBD/mysql/GetInfo.pm cp lib/DBD/mysql.pm blib/lib/DBD/mysql.pm cp lib/Bundle/DBD/mysql.pm blib/lib/Bundle/DBD/mysql.pm cp lib/DBD/mysql/INSTALL.pod blib/lib/DBD/mysql/INSTALL.pod cc -c -I/System/Library/Perl/Extras/5.18/darwin-thread-multi-2level/auto/DBI -I/usr/local/Cellar/mysql/5.7.21/include/mysql -DDBD_MYSQL_WITH_SSL -DDBD_MYSQL_INSERT_ID_IS_GOOD -g -arch x86_64 -arch i386 -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -fstack-protector -Os -DVERSION=\"4.046\" -DXS_VERSION=\"4.046\" "-I/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE" dbdimp.c /usr/bin/perl -p -e "s/~DRIVER~/mysql/g" /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level/auto/DBI/Driver.xst > mysql.xsi /usr/bin/perl /System/Library/Perl/5.18/ExtUtils/xsubpp -typemap /System/Library/Perl/5.18/ExtUtils/typemap mysql.xs > mysql.xsc && mv mysql.xsc mysql.c Warning: duplicate function definition 'do' detected in mysql.xs, line 249 Warning: duplicate function definition 'rows' detected in mysql.xs, line 670 cc -c -I/System/Library/Perl/Extras/5.18/darwin-thread-multi-2level/auto/DBI -I/usr/local/Cellar/mysql/5.7.21/include/mysql -DDBD_MYSQL_WITH_SSL -DDBD_MYSQL_INSERT_ID_IS_GOOD -g -arch x86_64 -arch i386 -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -fstack-protector -Os -DVERSION=\"4.046\" -DXS_VERSION=\"4.046\" "-I/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE" mysql.c Running Mkbootstrap for DBD::mysql () chmod 644 mysql.bs rm -f blib/arch/auto/DBD/mysql/mysql.bundle LD_RUN_PATH="/usr/local/Cellar/mysql/5.7.21/lib:/usr/lib" cc -arch x86_64 -arch i386 -bundle -undefined dynamic_lookup -fstack-protector dbdimp.o mysql.o -o blib/arch/auto/DBD/mysql/mysql.bundle \ -L/usr/local/Cellar/mysql/5.7.21/lib -lmysqlclient -lssl -lcrypto \ ld: library not found for -lssl clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [blib/arch/auto/DBD/mysql/mysql.bundle] Error 1 CAPTTOFU/DBD-mysql-4.046.tar.gz /usr/bin/make -- NOT OK Running make test Can't test without successful make Running make install Make had returned bad status, install seems impossible Failed during this command: CAPTTOFU/DBD-mysql-4.046.tar.gz : make NO
何度か試みましたが症状は変わらず。
#試したこと
参考サイトにエラーが出た時の対処法も書かれていたので試した結果が以下のようになりました。
bash
$ cd ~/.cpan/build $ cd DBD-mysql-4.046-nYXZ6d/ $ perl Makefile.PL I will use the following settings for compiling and testing: cflags (mysql_config ) = -I/usr/local/Cellar/mysql/5.7.21/include/mysql embedded (mysql_config ) = ldflags (guessed ) = libs (mysql_config ) = -L/usr/local/Cellar/mysql/5.7.21/lib -lmysqlclient -lssl -lcrypto mysql_config (guessed ) = mysql_config nocatchstderr (default ) = 0 nofoundrows (default ) = 0 nossl (default ) = 0 testdb (User's choice) = test testhost (default ) = testpassword (default ) = testport (default ) = testsocket (default ) = testuser (User's choice) = root To change these settings, see 'perl Makefile.PL --help' and 'perldoc DBD::mysql::INSTALL'. Using DBI 1.631 (for perl 5.018002 on darwin-thread-multi-2level) installed in /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level/auto/DBI/ Writing Makefile for DBD::mysql Wide character in print at /System/Library/Perl/5.18/ExtUtils/MakeMaker.pm line 1034. Wide character in print at /System/Library/Perl/5.18/ExtUtils/MakeMaker.pm line 1034. Writing MYMETA.yml and MYMETA.json $ ./configure sh: ./configure: No such file or directory $ make Skip blib/lib/DBD/mysql/INSTALL.pod (unchanged) Skip blib/lib/Bundle/DBD/mysql.pm (unchanged) Skip blib/lib/DBD/mysql.pm (unchanged) Skip blib/lib/DBD/mysql/GetInfo.pm (unchanged) cc -c -I/System/Library/Perl/Extras/5.18/darwin-thread-multi-2level/auto/DBI -I/usr/local/Cellar/mysql/5.7.21/include/mysql -DDBD_MYSQL_WITH_SSL -DDBD_MYSQL_INSERT_ID_IS_GOOD -g -arch x86_64 -arch i386 -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -fstack-protector -Os -DVERSION=\"4.046\" -DXS_VERSION=\"4.046\" "-I/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE" dbdimp.c cc -c -I/System/Library/Perl/Extras/5.18/darwin-thread-multi-2level/auto/DBI -I/usr/local/Cellar/mysql/5.7.21/include/mysql -DDBD_MYSQL_WITH_SSL -DDBD_MYSQL_INSERT_ID_IS_GOOD -g -arch x86_64 -arch i386 -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -fstack-protector -Os -DVERSION=\"4.046\" -DXS_VERSION=\"4.046\" "-I/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE" mysql.c Running Mkbootstrap for DBD::mysql () chmod 644 mysql.bs rm -f blib/arch/auto/DBD/mysql/mysql.bundle LD_RUN_PATH="/usr/local/Cellar/mysql/5.7.21/lib:/usr/lib" cc -arch x86_64 -arch i386 -bundle -undefined dynamic_lookup -fstack-protector dbdimp.o mysql.o -o blib/arch/auto/DBD/mysql/mysql.bundle \ -L/usr/local/Cellar/mysql/5.7.21/lib -lmysqlclient -lssl -lcrypto \ ld: library not found for -lssl clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [blib/arch/auto/DBD/mysql/mysql.bundle] Error 1
まず./configureが実行できず、makeも失敗しました。
続いて、以下を参考にcpanmを用いてインストールを試みました。
【Mac】KH Coder導入手順
bash
$ cpanm DBD::mysql --> Working on DBD::mysql Fetching http://www.cpan.org/authors/id/C/CA/CAPTTOFU/DBD-mysql-4.046.tar.gz ... OK Configuring DBD-mysql-4.046 ... OK Building and testing DBD-mysql-4.046 ... FAIL ! Installing DBD::mysql failed. See /var/root/.cpanm/work/1523867532.5166/build.log for details. Retry with --force to force install it.
なにか見落とした点やmysqlの設定不足などあるのかもしれませんが、なにかあればよろしくお願いします。
まだ回答がついていません
会員登録して回答してみよう