# Create a Guix container that shares the host's network devices, SSH | |
# config, and MySQL socket directory. The container includes all of | |
# the software that is needed to build the gem set with Bundler. | |
guix environment --container --network --share=$HOME/.ssh --share=/run/mysqld \ | |
--ad-hoc ruby bundler mysql imagemagick libxml2 libxslt gcc-toolchain \ | |
make git coreutils openssh libffi pkg-config which sed gawk openssl | |
# Tweak the environment such that Ruby gems end up in the right place | |
# and their binaries can be found. | |
export GEM_HOME=$PWD/.gems | |
export PATH=$GEM_HOME/bin:$PATH | |
# Create /usr/bin/env so Ruby scripts work. | |
mkdir -p /usr/bin && ln -s $(which env) /usr/bin/env | |
# Bundle! | |
bundle config build.nokogiri --use-system-libraries --with-xml2-include=$C_INCLUDE_PATH/libxml2 && bundle | |
# Start the server! | |
rails server |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment