Homebrew/TinyTDS/FreeTDS 包错误 [英] Homebrew / TinyTDS / FreeTDS bundle error

查看:21
本文介绍了Homebrew/TinyTDS/FreeTDS 包错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用自制软件(Linux 端口)来安装 freeTDS,并尝试使用 gem tinytds 部署/bundle install 我的应用程序.我在执行 bundle install 时得到这个错误输出

I used homebrew (linux port) to install freeTDS and am trying to deploy /bundle install my app with gem tinytds. I get this error output when doing bundle install

Installing tiny_tds (0.5.1) with native extensions 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /home/deployer/.rbenv/versions/1.9.2-p290/bin/ruby extconf.rb 

/usr/bin/ld: /opt/homebrew/lib/libsybdb.a(dblib.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC

/opt/homebrew/lib/libsybdb.a: could not read symbols: Bad value

与此修复程序非常相似,但我的文件夹中没有引用的文件:https://stackoverflow.com/a/7119224/1130736

Pretty similar to this fix, but I don't have the files referred to in my folder: https://stackoverflow.com/a/7119224/1130736

homebrew lib 文件夹的内容:

Contents of homebrew lib folder:

/opt/homebrew/lib$ ls
libct.a  libsybdb.a

完整的错误转储:

full error dump:

Installing tiny_tds (0.5.1) with native extensions 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /home/deployer/.rbenv/versions/1.9.2-p290/bin/ruby extconf.rb 
checking for iconv_open() in iconv.h... yes
checking for sybfront.h... yes
checking for sybdb.h... yes
checking for tdsdbopen() in -lsybdb... yes
checking for ct_bind() in -lct... yes
creating Makefile

make
/usr/bin/gcc -I. -I/home/deployer/.rbenv/versions/1.9.2-p290/include/ruby-1.9.1/x86_64-linux -I/home/deployer/.rbenv/versions/1.9.2-p290/include/ruby-1.9.1/ruby/backward -I/home/deployer/.rbenv/versions/1.9.2-p290/include/ruby-1.9.1 -I. -DHAVE_ICONV_OPEN -DHAVE_SYBFRONT_H -DHAVE_SYBDB_H -I/opt/homebrew/include -I/usr/local/include -I/usr/include -I'/home/deployer/.rbenv/versions/1.9.2-p290/include'    -fPIC -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long   -o client.o -c client.c
client.c: In function ‘tinytds_err_handler’:
client.c:52: warning: initialization discards qualifiers from pointer target type
client.c: In function ‘tinytds_msg_handler’:
client.c:100: warning: initialization discards qualifiers from pointer target type
/usr/bin/gcc -I. -I/home/deployer/.rbenv/versions/1.9.2-p290/include/ruby-1.9.1/x86_64-linux -I/home/deployer/.rbenv/versions/1.9.2-p290/include/ruby-1.9.1/ruby/backward -I/home/deployer/.rbenv/versions/1.9.2-p290/include/ruby-1.9.1 -I. -DHAVE_ICONV_OPEN -DHAVE_SYBFRONT_H -DHAVE_SYBDB_H -I/opt/homebrew/include -I/usr/local/include -I/usr/include -I'/home/deployer/.rbenv/versions/1.9.2-p290/include'    -fPIC -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long   -o result.o -c result.c
/usr/bin/gcc -I. -I/home/deployer/.rbenv/versions/1.9.2-p290/include/ruby-1.9.1/x86_64-linux -I/home/deployer/.rbenv/versions/1.9.2-p290/include/ruby-1.9.1/ruby/backward -I/home/deployer/.rbenv/versions/1.9.2-p290/include/ruby-1.9.1 -I. -DHAVE_ICONV_OPEN -DHAVE_SYBFRONT_H -DHAVE_SYBDB_H -I/opt/homebrew/include -I/usr/local/include -I/usr/include -I'/home/deployer/.rbenv/versions/1.9.2-p290/include'    -fPIC -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long   -o tiny_tds_ext.o -c tiny_tds_ext.c
/usr/bin/gcc -shared -o tiny_tds.so client.o result.o tiny_tds_ext.o -L. -L/home/deployer/.rbenv/versions/1.9.2-p290/lib -Wl,-R/home/deployer/.rbenv/versions/1.9.2-p290/lib -L/home/deployer/.rbenv/versions/1.9.2-p290/lib -Wl,-R/home/deployer/.rbenv/versions/1.9.2-p290/lib -L/opt/homebrew/lib -Wl,-R/opt/homebrew/lib -L/usr/lib -Wl,-R/usr/lib -L. -L'/home/deployer/.rbenv/versions/1.9.2-p290/lib'  -rdynamic -Wl,-export-dynamic    -lct -lsybdb  -lpthread -lrt -ldl -lcrypt -lm   -lc 
/usr/bin/ld: /opt/homebrew/lib/libsybdb.a(dblib.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/opt/homebrew/lib/libsybdb.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [tiny_tds.so] Error 1


Gem files will remain installed in /home/deployer/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/tiny_tds-0.5.1 for inspection.
Results logged to /home/deployer/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/tiny_tds-0.5.1/ext/tiny_tds/gem_make.out
An error occured while installing tiny_tds (0.5.1), and Bundler cannot continue.
Make sure that `gem install tiny_tds -v '0.5.1'` succeeds before bundling.'

推荐答案

我运行的是 Fedora,但对我来说修复的是

I run fedora, but the fix for me is

sudo yum install freetds-devel

我很确定你只需要有 freetds 的开发包就可以了.拿到开发包后,我的

I am pretty sure that you just need to have the development package of freetds for this to work. After I had the devel package, my

gem install tiny_tds

完美运行.

这篇关于Homebrew/TinyTDS/FreeTDS 包错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆