From ff5ccc6f8da12789e91a9673221ebafa6ac534a9 Mon Sep 17 00:00:00 2001 From: Yamashita Yuu Date: Sat, 18 May 2013 12:18:27 +0900 Subject: [PATCH] add page --- Common-build-problems.md | 73 ++++++++++++++++++++++++++++++++++++++++ _Sidebar.md | 1 + 2 files changed, 74 insertions(+) create mode 100644 Common-build-problems.md diff --git a/Common-build-problems.md b/Common-build-problems.md new file mode 100644 index 0000000..1645ec0 --- /dev/null +++ b/Common-build-problems.md @@ -0,0 +1,73 @@ +## zlib + +you need to install zlib-devel and rebuild Python. + +* Ubuntu: `sudo apt-get install libssl-dev zlib1g-dev` + +**NOTE**: `libssl-dev` is required when compiling Python, installing `libssl-dev` will actually install `zlib1g-dev`, this will help to eliminate subsequent **openssl (LoadError)** errors when running commands provided by RubyGems (for example vagrant and vmc), which leads to uninstall and re-install Python versions (installed before installing `libssl-dev`). + +* Fedora: `yum install zlib-devel` + + +## Readline support + +Install `libreadline-dev` first before running `python-build` + +* Ubuntu: `sudo apt-get install libreadline-dev` +* Fedora: `yum install readline-devel` +* Mac: +```bash +brew install readline +brew link readline +pyenv install 2.7.5 +``` + + +## Removing a ruby version + + rm -rf .pyenv/versions/2.7.5 + +## Installing a 32 bit ruby on 64 bit Mac OS X (this will *not* work on Linux) + + CONFIGURE_OPTS="--with-arch=i386" CFLAGS="-arch i386" LDFLAGS="-arch i386" python-build options + +## Installing a system-wide Python +If you want to install a Python interpreter that's available to all users and system scripts (no pyenv), use `/usr/local/` as the install path. For example: + + sudo python-build 3.3.2 /usr/local/ + +## Make your rubies a little faster +You can set your CFLAGS to accepted safe values to help get a little more speed. + + CFLAGS='-g -O2' + +## Build failed - bad interpreter: Permission denied + +If you encounter this error while installing ruby and your server is a VPS, the **/tmp** directory where python-build download and compile the packages is probably mounted as **noexec**. You can check with your hosting provider if wether they provide a way to bypass this protection. + +If the answer is no, just set the **$TMPDIR** environment variable to wherever you have a write + execution rights. For example: + + export TMPDIR="$HOME/src" + +Please note you'll have to do it every time you'll want to install a new version of ruby unless you write this command in your `~/.bashrc`. + +## Build failed + +If you've got something like that: + +``` +$ pyenv install 2.7.5 +Downloading http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz... +Installing yaml-0.1.4... + +BUILD FAILED +``` +please, be sure to have "make" installed (```$ sudo apt-get install make```). On Ubuntu Server, by default, it doesn't. + +## ruby-build: definition not found + +To update your python-build definitions: + +If you have python-build installed as an pyenv plugin: + + $ cd ~/.pyenv/plugins/python-build && git pull diff --git a/_Sidebar.md b/_Sidebar.md index 190807b..721b25e 100644 --- a/_Sidebar.md +++ b/_Sidebar.md @@ -1,4 +1,5 @@ * [[FAQ|Home]] +* [[Common build problems]] * [[pyenv plugins|Plugins]] * [[Deploying with pyenv]] * [[Understanding binstubs]]