ERROR: sql.h not found when installing ruby-odbc gem on Ubuntu
Install the unixodbc-dev package, then try the gem install again
sudo apt-get install unixodbc-dev
gem install ruby-odbc
Errors installing gems locally - how can I install slacker offline?
I have answered question 1 myself. If anyone else can give me a definitive answer to part two, I will happily mark that as the answer.
I guessed that I needed to download and install the mingw
packages that couldn't be downloaded somewhere. I did a bit of trawling and found this article (Offline installation of packages)which gave me the pointers I needed. I got these four files from https://repo.msys2.org/mingw/mingw64/:
mingw-w64-x86_64-freetds-1.2.6-2-any.pkg.tar.zst
mingw-w64-x86_64-libtasn1-4.18.0-1-any.pkg.tar.zst
mingw-w64-x86_64-openssl-1.1.1.l-1-any.pkg.tar.zst
mingw-w64-x86_64-p11-kit-0.24.0-1-any.pkg.tar.zst
And mingw-w64-x86_64-ca-certificates-20210119-1-any.pkg.tar.zst
from https://ftp.acc.umu.se/mirror/msys2.org/mingw/mingw64/.
I copied them to: C:\Ruby27-x64\msys64\home\myUserId\freetds
which is in my home dir in msys
. (From errors I got the first time, it looks like the folder name has to match the database name.) Then I started msys
by running: C:\Ruby27-x64\msys64\msys2.exe
.
In msys
, I ran:
cd freetds/
then, to create a repository database just for freetds:
$ repo-add freetds.db.tar.gz *.pkg.tar.zst
I got a bunch of messages telling me it was ==> Adding package 'ming...
I needed to edit the pacman.conf file to point to my temp database, so I made a copy of the pacman.conf file:
cp /etc/pacman.conf /etc/pacman.conf.old
I edited pacman.conf
in Notepad++, changing SigLevel
to = Never
, commenting out the other repositories, and adding this to the end:
[freetds]
Server = file:///home/myUserId/freetds
Then, I made pacman
synchronise with the database I created:
pacman -Sy
:: Synchronizing package databases...
freetds 1676.0 B 7.54 KiB/s 00:00 [#####################] 100%
I tried gem install slacker
again but there was another missing package "mingw-w64-x86_64-libffi
, so I downloaded mingw-w64-x86_64-libffi-3.3-4-any.pkg.tar.zst
and put it in the same place, re-ran the repo-add
command and pacman Sy
and then gem install slacker
.
This worked and I got 10 gems installed
. I've run the test project documented in the slacker GitHub pages and it worked.
Ruby on Rail gem install activerecord-sqlserver-adapter error
Try to add such line in your %APP_ROOT%/Gemfile
gem 'activerecord-sqlserver-adapter'
I can't get the ruby development kit working for Windows XP
You're killing yourself.
For Win32 operating systems DLLs of
0.997 are available in i386-msvcrt-ruby-odbc.zip. It contains
the files odbc.so and odbc_utf8.so
which need to be copied into the
.../ruby/1.8/i386-msvcrt directory of
MSVC based Ruby 1.8 installations.
Try putting those files where recommended, then installing that version of the gem, and see how it goes.
Can't find the 'libpq-fe.h header when trying to install pg gem
It looks like in Ubuntu that header is part of the libpq-dev
package (at least in the following Ubuntu versions:
11.04 (Natty Narwhal), 10.04 (Lucid Lynx), 11.10 (Oneiric Ocelot), 12.04 (Precise Pangolin), 14.04 (Trusty Tahr) and 18.04 (Bionic Beaver)):
...
/usr/include/postgresql/libpq-fe.h
...
So try installing libpq-dev
or its equivalent for your OS:
- For Ubuntu/Debian systems:
sudo apt-get install libpq-dev
- On Red Hat Linux (RHEL) systems:
yum install postgresql-devel
- For Mac Homebrew:
brew install postgresql
- For Mac MacPorts PostgreSQL:
gem install pg -- --with-pg-config=/opt/local/lib/postgresql[version number]/bin/pg_config
- For OpenSuse:
zypper in postgresql-devel
- For ArchLinux:
pacman -S postgresql-libs
Related Topics
Change The Ruby Process Name in Top
Ruby - Platform Independent Way to Determine Ips of All Network Interfaces
How to Send Message to All Client Except Sender in Rails/Actioncable
Rvm with Jruby 1.7.0 "Unknown Ruby Interpreter"
What the Purpose of Bind/Unbind Methods in Ruby
Gmail Threading, Imap and Ruby
How to Export a Rails Model to JSON Schema
Phonegap and Rails 3: How to Interact with a Rails 3 App
Determining Whether One Array Contains the Contents of Another Array in Ruby
How to Use Present? in Ruby Projects
Using Negative Conditions Within Regular Expressions
How to Declare a Rake Task That Depends on a Parameterized Task
Undefined Method 'Devise' When Including User Model Outside Rails
More Efficient Ruby Way to Map Attribute in Array of Objects to Another Array
How to Read from Redis Inside a Multi Block in Ruby