简体   繁体   English

使用Ubuntu,如何从CPAN安装DBD :: Sybase?

[英]Using Ubuntu, how do I install DBD::Sybase from CPAN?

Whenever I try to build DBD::Sybase to connect to MSSQL I get an error, 每当我尝试构建DBD::Sybase连接到MSSQL时,我都会收到错误,

$ sudo cpanp install DBD::Sybase


Installing DBD::Sybase (1.15)
Running [/usr/bin/perl /usr/bin/cpanp-run-perl /home/ecarroll/.cpanplus/5.14.2/build/DBD-Sybase-1.15/Makefile.PL INSTALLDIRS=site]...
Can't find any Sybase libraries in /etc/lib or /etc/lib64 at /home/ecarroll/.cpanplus/5.14.2/build/DBD-Sybase-1.15/Makefile.PL line 155, <IN> line 44.
BEGIN failed--compilation aborted at /usr/bin/cpanp-run-perl line 11, <IN> line 44.
[ERROR] Could not run '/usr/bin/perl Makefile.PL': Can't find any Sybase libraries in /etc/lib or /etc/lib64 at /home/ecarroll/.cpanplus/5.14.2/build/DBD-Sybase-1.15/Makefile.PL line 155, <IN> line 44.
BEGIN failed--compilation aborted at /usr/bin/cpanp-run-perl line 11, <IN> line 44.
 -- cannot continue

[ERROR] Unable to create a new distribution object for 'DBD::Sybase' -- cannot continue

*** Install log written to:
  /home/ecarroll/.cpanplus/install-logs/DBD-Sybase-1.15-1374605483.log

Error installing 'DBD::Sybase'
Problem installing one or more modules

I've also gotten this error on other Debian systems. 我在其他Debian系统上也遇到了这个错误。

There are two ways to do that, 有两种方法可以做到

  • (a) with the freetds that the distro provides (a)与发行版提供的freetds
  • or, (b) installing the vanilla freetds upstream and building against that. 或者,(b)在上游安装香草freetds并对其进行建设。

The second option (b) is always possible, but then your system may have two different versions of freetds. 第二个选项(b)总是可行的,但是你的系统可能有两个不同版本的freetds。

The first option can not be done without some hacking and the author will not fix it. 如果没有一些黑客攻击,第一个选项就无法完成,作者也无法修复它。 He is simply hard headed and wants to fix internal structures to match the OS he uses rather than making it accepting of other configurations. 他只是头脑冷静,想要修复内部结构以匹配他使用的操作系统,而不是让它接受其他配置。

Internally DBD::Sybase expects there to be a directory, and a $libdir (a subdirectory with lib or lib64 ). 在内部DBD::Sybase期望有一个目录和$libdir (带有liblib64的子目录)。 The directories DBD::Sybase requires to build properly are not provided by the Debian package freetds-dev ; Debian软件包freetds-dev 提供DBD::Sybase需要正确构建的目录; the Debian package installs to /usr/include which doesn't have a lib or a lib64 subdirectory. Debian软件包安装到/usr/include ,它没有liblib64子目录。 You can get around this by fooling make and recreating that structure, first make sure you have freetds-dev installed, 您可以通过欺骗make并重新创建该结构来解决这个问题,首先确保安装了freetds-dev

sudo apt-get install freetds-dev

Then link it to create a pseudo-package. 然后链接它以创建一个伪包。 On my 64 bit machine, it looks something like this. 在我的64位机器上,它看起来像这样。

mkdir /tmp/freetds
ln -s /usr/lib/x86_64-linux-gnu/ /tmp/freetds/lib64
ln -s /usr/include /tmp/freetds/include/freetds

Now, it should work and you can build DBD::Sybase against system libraries. 现在,它应该工作,您可以针对系统库构建DBD::Sybase

sudo SYBASE=/tmp/freetds cpanp install DBD::Sybase

Viola. 中提琴。

To install modules for the system perl, you can install the packages from the Ubuntu repositories. 要为系统perl安装模块,可以从Ubuntu存储库安装软件包。 While these may be out of date, library dependencies are resolved aoutomatically. 虽然这些可能已过时,但库依赖关系是经常解决的。 In this case, a 在这种情况下,一个

$ sudo apt-get install libdbd-sybase-perl

should do the trick. 应该做的伎俩。

我相信你必须创建include子目录,否则第二个ln将失败:

mkdir /tmp/freetds/include

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何通过DBD :: Sybase调整FreeTDS选项? - How do you adjust FreeTDS options through DBD::Sybase? 如何使用Perl和DBD :: ODBC从SQL Server查询视图? - How do I query a view from SQL server with Perl and DBD::ODBC? 如何从ubuntu和php 5.3.10连接到mssql - How do I connect to mssql from ubuntu and php 5.3.10 带有Perl DBD :: Sybase的Nagios check_mssql_health(无FreeTds) - Nagios check_mssql_health with perl DBD::Sybase without FreeTds 我想使用来自不同服务器(一个Sybase另一个MS)的SQL查询合并数据集 - I'd like to merge data sets using an SQL query from different servers (one Sybase the other MS) 如何在ubuntu 12.04中安装mssql - How to install mssql in ubuntu 12.04 如何在Ubuntu 14.04中安装mssql - How to install mssql in ubuntu 14.04 如何从 ZC5FD214CDD0D2B3B4272E 中的 python 容器脚本连接到 Ubuntu 上的本地 SQL 服务器 - How do I connect to the local SQL server on Ubuntu from a python script in Docker container Apache 授权使用 require dbd-group 来自 SQL 服务器数据库 - Apache authorization using require dbd-group from SQL Server database 我如何知道我的 bacpac 用于哪个版本的 SQL 服务器? (我在 Ubuntu 上使用 SQL Server 2019 express) - How do I know which version of SQL Server my bacpac is for? (I'm using SQL Server 2019 express on Ubuntu )
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM