client.c:439:3: error: use of undeclared identifier 'my_bool'

Python010

client.c:439:3: error: use of undeclared identifier 'my_bool',第1张

解决方式:

把mysql的gem版本换成0.5.2

再bundle

bundle完之後再改回原本的版本就不影响团队开发。

原则就是可以顺利跑完bundle就好,暂时更改版号骗过bundle

Gemfile

gem "mysql2", "~>0.5.2"

发生问题:

$ sudo gem install mysql2 -v 0.3.21

Building native extensions. This could take a while...

ERROR:  Error installing mysql2:

ERROR: Failed to build gem native extension.

    current directory: /Users/huyy01/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/mysql2-0.3.21/ext/mysql2

/Users/huyy01/.rbenv/versions/2.5.1/bin/ruby -r ./siteconf20180724-29825-pksvq0.rb extconf.rb

checking for ruby/thread.h... yes

checking for rb_thread_call_without_gvl() in ruby/thread.h... yes

checking for rb_thread_blocking_region()... no

checking for rb_wait_for_single_fd()... yes

checking for rb_hash_dup()... yes

checking for rb_intern3()... yes

-----

Using mysql_config at /usr/local/bin/mysql_config

-----

checking for mysql.h... yes

checking for errmsg.h... yes

checking for mysqld_error.h... yes

-----

Setting rpath to /usr/local/Cellar/mysql/8.0.11/lib

-----

creating Makefile

current directory: /Users/huyy01/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/mysql2-0.3.21/ext/mysql2

make "DESTDIR=" clean

current directory: /Users/huyy01/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/mysql2-0.3.21/ext/mysql2

make "DESTDIR="

compiling client.c

client.c:439:3: error: use of undeclared identifier 'my_bool'

  my_bool res = mysql_read_query_result(client)

  ^

client.c:441:19: error: use of undeclared identifier 'res'

  return (void *)(res == 0 ? Qtrue : Qfalse)

                  ^

client.c:762:3: error: use of undeclared identifier 'my_bool'

  my_bool boolval

  ^

client.c:793:7: error: use of undeclared identifier 'boolval'

      boolval = (value == Qfalse ? 0 : 1)

      ^

client.c:794:17: error: use of undeclared identifier 'boolval'

      retval = &boolval

                ^

client.c:797:10: error: use of undeclared identifier 'MYSQL_SECURE_AUTH'did you mean 'MYSQL_DEFAULT_AUTH'?

    case MYSQL_SECURE_AUTH:

         ^~~~~~~~~~~~~~~~~

         MYSQL_DEFAULT_AUTH

/usr/local/Cellar/mysql/8.0.11/include/mysql/mysql.h:188:3: note: 'MYSQL_DEFAULT_AUTH' declared here

  MYSQL_DEFAULT_AUTH,

  ^

client.c:798:7: error: use of undeclared identifier 'boolval'

      boolval = (value == Qfalse ? 0 : 1)

      ^

client.c:799:17: error: use of undeclared identifier 'boolval'

      retval = &boolval

                ^

client.c:830:38: error: use of undeclared identifier 'boolval'

        wrapper->reconnect_enabled = boolval

                                     ^

client.c:1185:38: error: use of undeclared identifier 'MYSQL_SECURE_AUTH'did you mean 'MYSQL_DEFAULT_AUTH'?

  return _mysql_client_options(self, MYSQL_SECURE_AUTH, value)

                                     ^~~~~~~~~~~~~~~~~

                                     MYSQL_DEFAULT_AUTH

/usr/local/Cellar/mysql/8.0.11/include/mysql/mysql.h:188:3: note: 'MYSQL_DEFAULT_AUTH' declared here

  MYSQL_DEFAULT_AUTH,

  ^

10 errors generated.

make: *** [client.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/huyy01/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/mysql2-0.3.21 for inspection.

Results logged to /Users/huyy01/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/extensions/x86_64-darwin-17/2.5.0-static/mysql2-0.3.21/gem_make.out

sh-huyy01:redmine huyy01$ cd /Users/huyy01/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/

安装OpenVAS

OpenVAS工具的安装比较简单,而且在OpenVAS官网提供了在各种操作系统中的安装方法。其下载地址为http://www.openvas.org/install-packages.html。但是,如果用户在安装时,可能会出现很多依赖包需要手动解决。如果不能够很好的解决依赖关系包,将无法成功安装OpenVAS工具。所以,为了方便用户使用,Kali Linux系统中已经默认安装了该工具,用户可以直接使用。

如果用户发现自己系统中安装的OpenVAS不是最新版本的话,可以通过以下方法安装最新版的OpenVAS工具。具体方法如下所示:

(1)更新软件包列表。执行命令如下所示:

root@Kali :~# apt-get update

执行以上命令后,将会获取最近的软件包列表。

(2)获取到最新的软件包,。执行命令如下所示:

root@Kali :~# apt-get dist-upgrade

执行以上命令后,将会对有更新的包进行下载并安装。

(3)重新安装OpenVAS工具。执行命令如下所示:

root@Kali :~# apt-get install openvas

执行以上命令后,如果没有报错,则说明已成功安装OpenVAS工具。如果当前系统中已经安装了最新版的OpenVAS软件,将会显示以下类似信息:

正在读取软件包列表... 完成

正在分析软件包的依赖关系树

正在读取状态信息... 完成

openvas 已经是最新的版本了。

下列软件包是自动安装的并且现在不需要了:

firmware-mod-kit libafpclient0 libhackrf liblzma-dev libmozjs22d libnet-daemon-perl libnfc3 libplrpc-perl

libruby libtsk3-3 libwireshark2 libwiretap2 libwsutil2 openjdk-7-jre-lib python-apsw python-utidylib

ruby-crack ruby-diff-lcs ruby-rspec ruby-rspec-core ruby-rspec-expectations ruby-rspec-mocks ruby-simplecov

ruby-simplecov-html unrar-free xulrunner-22.0

Use 'apt-get autoremove' to remove them.

升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 20 个软件包未被升级。

从以上输出信息中,可以看到OpenVAS已经是最新版本了。

Ruby 1.8.2

Rails 1.0.0

SQLite 3.3.3

下载 sqlite-3_3_3.zip sqlitedll-3_3_3.zip

解压它们,得到文件sqlite3.exe和sqlite3.dll;

复制它们到目录[RUBY_HOME]/bin下面;

SQLite-Ruby 1.1.0

如下命令安装该模块是针对SQLite 3.x版本:

gem install sqlite3-ruby -r -y

SQLite 3.x的可视化工具:SQLite Database Browser

解压它,我们得到软件SQLite Database Browser 1.2.1.exe