Skip to content
This repository has been archived by the owner on Dec 4, 2023. It is now read-only.

Fails to compile on Centos5 #59

Closed
jperry opened this issue Dec 6, 2012 · 4 comments
Closed

Fails to compile on Centos5 #59

jperry opened this issue Dec 6, 2012 · 4 comments

Comments

@jperry
Copy link

jperry commented Dec 6, 2012

Hi,

I have gem 'libv8' in my Gemfile using ruby 1.9.3 and I'm getting a failure when I run bundle install

creating Makefile
Using compiler: /usr/bin/g++44
Traceback (most recent call last):
  File "build/gyp/gyp", line 15, in ?
    import gyp
  File "build/gyp/pylib/gyp/__init__.py", line 8, in ?
    import gyp.input
  File "build/gyp/pylib/gyp/input.py", line 14, in ?
    import gyp.common
  File "build/gyp/pylib/gyp/common.py", line 375
    with open(source_path) as source_file:
            ^
SyntaxError: invalid syntax
gmake: *** [out/Makefile.x64] Error 1
GYP_GENERATORS=make \
    build/gyp/gyp --generator-output="out" build/all.gyp \
                  -Ibuild/standalone.gypi --depth=. \
                  -Dv8_target_arch=x64 \
                  -S.x64 -Dhost_arch=x64

Any thoughts on this?

@cheald
Copy link

cheald commented Dec 8, 2012

This is because v8 needs python 2.6 or better to install. Centos5 ships with 2.4. You'll have to upgrade python, as well as your /usr/bin/python symlink. Additionally, you need GCC4.3 or 4.4.

yum install gcc44-c++ python26 -y
ln -s /usr/bin/python26 /usr/local/bin/python

This got it installing for me.

@lidaobing
Copy link

@cheald I think it's dangerous to replace the /usr/bin/python

@cheald
Copy link

cheald commented Dec 10, 2012

@lidaobing /usr/local/bin/python just "hides" /usr/bin/python, it doesn't replace it. Installing python-2.6 adds a /usr/bin/python26 binary parallel to the /usr/bin/python 2.4 binary. We just symlink that to /usr/local/bin and it's found first when the path is searched.

@lidaobing
Copy link

@cheald you code is correct, but description is wrong: " You'll have to upgrade python, as well as your /usr/bin/python symlink."

@cowboyd cowboyd closed this as completed Dec 18, 2012
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants