Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby 在Ubuntu 15.04(64位)上安装BDB时出错;Gem::Ext::BuildError:错误:未能生成Gem本机扩展。”;_Ruby_Linux_Ubuntu - Fatal编程技术网

Ruby 在Ubuntu 15.04(64位)上安装BDB时出错;Gem::Ext::BuildError:错误:未能生成Gem本机扩展。”;

Ruby 在Ubuntu 15.04(64位)上安装BDB时出错;Gem::Ext::BuildError:错误:未能生成Gem本机扩展。”;,ruby,linux,ubuntu,Ruby,Linux,Ubuntu,操作系统:Ubuntu 15.04(64位) Ruby版本:Ruby 1.9.3p551(2014-11-13修订版48407)[x86_64-linux] 在运行gem install bdb时,我遇到以下错误,有人能指出错误的可能原因,或者提供解决方法的指针吗 Error installing bdb: Error: Failed to build gem native extension Gem::Ext::BuildError: ERROR: Failed to build gem na

操作系统:Ubuntu 15.04(64位)

Ruby版本:Ruby 1.9.3p551(2014-11-13修订版48407)[x86_64-linux]

在运行gem install bdb时,我遇到以下错误,有人能指出错误的可能原因,或者提供解决方法的指针吗

Error installing bdb:
Error: Failed to build gem native extension
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

/usr/share/rvm/rubies/ruby-1.9.3-p551/bin/ruby -r ./siteconf20151216-2783-1lobclo.rb extconf.rb
checking for db_version() in -ldb-5.1... no
checking for db_version() in -ldb-5.0... no
checking for db_version() in -ldb-4.9... no
checking for db_version() in -ldb-4.8... no
checking for db_version() in -ldb-4.7... no
checking for db_version() in -ldb-4.6... no
checking for db_version() in -ldb-4.5... no
checking for db_version() in -ldb-4.4... no
checking for db_version() in -ldb-4.3... no
checking for db_version() in -ldb-4.2... no
Writing bdb_aux._c (defines), this takes a while
don't know how to handle DB_DEGREE_2 DB_READ_COMMITTED, guessing UINT
don't know how to handle DB_DIRTY_READ DB_READ_UNCOMMITTED, guessing UINT
don't know how to handle DB_HEAP_RID_SZ (sizeof(db_pgno_t) + sizeof(db_indx_t)), guessing UINT

wrote 501 defines
creating Makefile

make  clean

make
compiling bdb.c
bdb.c: In function ‘raise_error’:
bdb.c:82:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
  VALUE cl;
  ^
bdb.c:84:0: warning: "eDbE_create" redefined
 #define eDbE_create(n,c) case DB_##n: cl = eDbE_##c; break;
 ^
bdb.c:50:0: note: this is the location of the previous definition
 #define eDbE_create(n,c) VALUE eDbE_##c;
 ^
bdb.c: In function ‘db_open’:
bdb.c:266:9: warning: implicit declaration of function ‘raise’ [-Wimplicit-function-declaration]
         raise(0, "txn is closed");
         ^
bdb.c: In function ‘db_get_re_len’:
bdb.c:330:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
  int rv = dbh->db->get_re_len(dbh->db,&re_len);
  ^
bdb.c: In function ‘db_set_encrypt’:
bdb.c:1074:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
     u_int32_t flags=0x00000001; //DB_ENCRYPT_AES
     ^
In file included from /usr/share/rvm/rubies/ruby-1.9.3-p551/include/ruby-1.9.1/ruby.h:32:0,
                 from ./bdb.h:5,
                 from bdb.c:8:
bdb.c: In function ‘assoc_rescue’:
/usr/share/rvm/rubies/ruby-1.9.3-p551/include/ruby-1.9.1/ruby/ruby.h:909:30: warning: format not a string literal and no format arguments [-Wformat-security]
 #define RSTRING(obj) (R_CAST(RString)(obj))
                              ^
/usr/share/rvm/rubies/ruby-1.9.3-p551/include/ruby-1.9.1/ruby/ruby.h:903:30: note: in definition of macro ‘R_CAST’
 #define R_CAST(st)   (struct st*)
                              ^
/usr/share/rvm/rubies/ruby-1.9.3-p551/include/ruby-1.9.1/ruby/ruby.h:679:6: note: in expansion of macro ‘RSTRING’
      RSTRING(str)->as.heap.ptr)
      ^
bdb.c:1200:11: note: in expansion of macro ‘RSTRING_PTR’
   rb_warn(RSTRING_PTR(message));
           ^
bdb.c: In function ‘assoc_callback’:
bdb.c:1248:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       for (i=0; i<skey->size; i++) {
                  ^
bdb.c:1249:30: warning: pointer of type ‘void *’ used in arithmetic [-Wpointer-arith]
         assoc_key(skey->data + i * sizeof(DBT), (VALUE)RARRAY_PTR(keys)[i]);
                              ^
bdb.c: In function ‘db_stat’:
bdb.c:2141:3: warning: enumeration value ‘DB_HEAP’ not handled in switch [-Wswitch]
   switch(dbtype) {
   ^
bdb.c: In function ‘env_txn_stat’:
bdb.c:2299:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (i=0; i<statp->st_nactive; i++) {
              ^
bdb.c: In function ‘env_get_data_dirs’:
bdb.c:2751:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
  VALUE rb_data_dirs = rb_ary_new2(ln);
  ^
bdb.c: In function ‘env_set_encrypt’:
bdb.c:2912:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
   u_int32_t flags=0x00000001; //DB_ENCRYPT_AES
   ^
bdb.c: In function ‘env_repmgr_set_local_site’:
bdb.c:3005:15: error: ‘DB_ENV’ has no member named ‘repmgr_set_local_site’
   rv = eh->env->repmgr_set_local_site(eh->env, StringValuePtr(host), NUM2UINT(port), 0);
               ^
bdb.c: In function ‘env_repmgr_add_remote_site’:
bdb.c:3024:15: error: ‘DB_ENV’ has no member named ‘repmgr_add_remote_site’
   rv = eh->env->repmgr_add_remote_site(eh->env, StringValuePtr(host), NUM2UINT(port), &eidp, 0);
               ^
bdb.c: In function ‘env_get_lg_bsize’:
bdb.c:3119:3: warning: implicit declaration of function ‘UINT2FIX’ [-Wimplicit-function-declaration]
   return UINT2FIX(size);
   ^
bdb.c: In function ‘Init_bdb’:
bdb.c:3331:0: warning: "eDbE_create" redefined
 #define eDbE_create(n,c) eDbE_##c = rb_define_class_under(mBdb, #c, eDbError);
 ^
bdb.c:84:0: note: this is the location of the previous definition
 #define eDbE_create(n,c) case DB_##n: cl = eDbE_##c; break;
 ^
bdb.c:3424:0: warning: "ENV_LOG_CONFIG_FUNC" redefined
 #define ENV_LOG_CONFIG_FUNC(name,cnst) \
 ^
bdb.c:2533:0: note: this is the location of the previous definition
 #define ENV_LOG_CONFIG_FUNC( name, cnst) \
 ^
Makefile:206: recipe for target 'bdb.o' failed
make: *** [bdb.o] Error 1

make failed, exit code 2
安装bdb时出错: 错误:无法生成gem本机扩展 Gem::Ext::BuildError:错误:无法生成Gem本机扩展。 /usr/share/rvm/rubies/ruby-1.9.3-p551/bin/ruby-r./siteconf20151216-2783-1lobclo.rbextconf.rb 正在检查-ldb-5.1中的db_version()。。。不 正在检查-ldb-5.0中的db_version()。。。不 正在检查-ldb-4.9中的db_version()。。。不 正在检查-ldb-4.8中的db_version()。。。不 正在检查-ldb-4.7中的db_version()。。。不 正在检查-ldb-4.6中的db_version()。。。不 正在检查-ldb-4.5中的db_version()。。。不 正在检查-ldb-4.4中的db_version()。。。不 正在检查-ldb-4.3中的db_version()。。。不 正在检查-ldb-4.2中的db_version()。。。不 编写bdb_aux._c(定义),这需要一段时间 不知道如何处理DB_DEGREE_2 DB_READ_COMMITTED,猜测UINT 不知道如何处理DB_DIRTY_READ DB_READ_UNCOMMITTED,猜测UINT 不知道如何处理DB_HEAP_RID_SZ(sizeof(DB_pgno_t)+sizeof(DB_indx_t)),猜测UINT 编写501定义 创建Makefile 澄清 制作 编译bdb.c bdb.c:在函数“raise_error”中: bdb.c:82:2:警告:ISO C90禁止混合声明和代码[-Wdeclaration after statement] 价值cl; ^ bdb.c:84:0:警告:“eDbE_create”已重新定义 #定义eDbE#u create(n,c)case DB###n:cl=eDbE##c;打破 ^ bdb.c:50:0:注意:这是前面定义的位置 #定义eDbE#u创建(n,c)值eDbE##c; ^ bdb.c:在函数“db_open”中: bdb.c:266:9:警告:函数“raise”的隐式声明[-Wimplicit函数声明] 升高(0,“txn关闭”); ^ bdb.c:在函数“db_get_re_len”中: bdb.c:330:2:警告:ISO C90禁止混合声明和代码[-Wdeclaration after statement] int rv=dbh->db->get_re_len(dbh->db和re_len); ^ bdb.c:在函数“db\u set\u encrypt”中: bdb.c:1074:5:警告:ISO C90禁止混合声明和代码[-Wdeclaration after statement] u_int32_t flags=0x00000001//数据库加密 ^ 在/usr/share/rvm/rubies/ruby-1.9.3-p551/include/ruby-1.9.1/ruby.h:32:0中包含的文件中, 自./bdb.h:5, 摘自bdb.c:8: bdb.c:在“援助救援”功能中: /usr/share/rvm/rubies/ruby-1.9.3-p551/include/ruby-1.9.1/ruby/ruby.h:909:30:警告:格式不是字符串文字,也没有格式参数[-Wformat-security] #定义RSTRING(obj)(R_CAST(RSTRING)(obj)) ^ /usr/share/rvm/rubies/ruby-1.9.3-p551/include/ruby-1.9.1/ruby/ruby.h:903:30:注意:在宏“R_CAST”的定义中 #定义R_CAST(st)(结构st*) ^ /usr/share/rvm/rubies/ruby-1.9.3-p551/include/ruby-1.9.1/ruby/ruby.h:679:6:注意:在宏“RSTRING”的扩展中 RSTRING(str)->as.heap.ptr) ^ bdb.c:1200:11:注意:在宏“RSTRING_PTR”的展开中 rb_警告(RSTRING_PTR(消息)); ^ bdb.c:在函数“assoc_callback”中: bdb.c:1248:18:警告:有符号和无符号整数表达式之间的比较[-Wsign compare] 对于(i=0;isize;i++){ ^ bdb.c:1249:30:警告:算术[-Wpointer arith]中使用的“void*”类型指针 关联键(skey->data+i*sizeof(DBT),(值)RARRAY\u PTR(键)[i]); ^ bdb.c:在函数“db_stat”中: bdb.c:2141:3:警告:枚举值“DB_HEAP”未在开关[-Wswitch]中处理 开关(dbtype){ ^ bdb.c:在函数“env_txn_stat”中: bdb.c:2299:14:警告:有符号和无符号整数表达式之间的比较[-Wsign compare] 对于(i=0;ist_nactive;i++){ ^ bdb.c:在函数“env_get_data_dirs”中: bdb.c:2751:2:警告:ISO C90禁止混合声明和代码[-Wdeclaration after statement] 值rb_data_dirs=rb_ary_new2(ln); ^ bdb.c:在函数“env_set_encrypt”中: bdb.c:2912:3:警告:ISO C90禁止混合声明和代码[-Wdeclaration after statement] u_int32_t flags=0x00000001;//DB_ENCRYPT\u AES ^ bdb.c:在函数“env_repmgr_set_local_site”中: bdb.c:3005:15:错误:“DB_ENV”没有名为“repmgr_set_local_site”的成员 rv=eh->env->repmgr\u set\u local\u site(eh->env,StringValuePtr(主机),NUM2UINT(端口),0); ^ bdb.c:在函数“env_repmgr_add_remote_site”中: bdb.c:3024:15:错误:“DB_ENV”没有名为“repmgr_add_remote_site”的成员 rv=eh->env->repmgr\u添加\u远程\u站点(eh->env、StringValuePtr(主机)、NUM2UINT(端口)和eidp,0); ^ bdb.c:在函数“env_get_lg_bsize”中: bdb.c:3119:3:警告:函数“UINT2FIX”的隐式声明[-Wimplicit函数声明] 返回UINT2FIX(大小); ^ bdb.c:在函数“Init_bdb”中: bdb.c:3331:0:警告:“eDbE_create”已重新定义 #在(mBdb,#c,eDbError)下定义eDbE#u创建(n,c)eDbE##c=rb#u定义#u类; ^ bdb.c:84:0:注意:这是前面定义的位置 #定义eDbE#u create(n,c)case DB###n:cl=eDbE##c;break; ^ bdb.c:3424:0:警告:“重新定义了环境日志配置函数” #定义环境日志配置函数(名称,cnst)\ ^ bdb.c:2533:0:注意:这是前面定义的位置 #定义环境日志配置函数(名称,cnst)\ ^ Makefile:206:目标“bdb.o”的配方失败 make:**[bdb.o]错误1 make失败,退出代码2