Installation of Berkshelf v3 on Cygwin is known to be very diffcult, but I have finally found the way. 😄
You can successfully install it by following the procedure below.
(As at 2014/6/8, v3.1.3 is available)
Among the gems on which Berkshelf depends, there are two gems that are difficult to install:
- ffi
- dep-selector-libgecode
In other words, if you can install just these two gems, you should be able to install Berkshelf.
So Let’s give it a try!
Cygwin 64bit
(I used Windows 7, but believe it will also work on Windows 8)
Install the following:
- apt-cyg
- rbenv , ruby version 2.1
Put this file in a directory of your $PATH
https://raw.githubusercontent.com/kou1okada/apt-cyg/master/apt-cyg
e.g. C:\cygwin64\usr\local\bin\apt-cyg.
and set it executable
chmod 0755 /usr/local/bin/apt-cyg
Install required packages using apt-cyg
$ apt-cyg install git gcc-core gcc-g++ make zlib-devel curl \
autoconf libiconv libiconv-devel rsync patch unzip openssh openssl-\
devel libxml2-devel libxslt-devel libffi-devel libgdbm-devel
Install rbenv and ruby-build
This follows the official manual.
git clone git://github.com/sstephenson/rbenv.git ~/.rbenv
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
$SHELL --login
rbenv install 2.1.0-rc1
rbenv global 2.1.0-rc1
rbenv rehash
That’s it!
Validation/confirmation
$ ruby -v
ruby 2.1.0dev (2013-12-20 trunk 44301) [x86_64-cygwin]
You can install ffi per the above comment from RSmirnov:
$ apt-cyg install libffi6 libffi-devel pkg-config
$ export PKG_CONFIG_PATH="/lib/pkgconfig"
$ gem install ffi
# Create symlinks to gcc48.exe, g++48.exe
$ ln -s gcc.exe /usr/bin/gcc48.exe
$ ln -s g++.exe /usr/bin/g++48.exe
# Download and unzip gecode 3.7.3
$ wget "http://pkgs.fedoraproject.org/repo/pkgs/gecode/gecode-3.7.3.tar.gz/7a5cb9945e0bb48f222992f2106130ac/gecode-3.7.3.tar.gz"
$ tar xvfz gecode-3.7.3.tar.gz
$ cd gecode-3.7.3
# Compile
$ ./configure CC="gcc48" --disable-doc-dot --disable-doc-search --disable-doc-tagfile --disable-doc-chm --disable-doc-docset --disable-qt --disable-examples --disable-flatzinc
$ make
$ make install
# Manually install the libraries
$ cp libgecode* /lib/
$ cp -r gecode/* /usr/include/
c.f. http://qiita.com/yositani2002/items/6e9b765452676a40a2ef
$ USE_SYSTEM_GECODE=1 gem install berkshelf
Confirmation
$ berks --version
DL is deprecated, please use Fiddle
3.1.3
Did it work?
This document is originally writen in Qiita by Japansese.
http://qiita.com/DQNEO/items/207a2e7f6f32e8cc2f7f
English Translation was made by J.Z.
I’d like to express my profound gratitude to all those whose work made this possible.