【转】Installing the libv8 Ruby gem on Centos 5.8
转自:http://appsintheopen.com/posts/18-installing-the-libv8-ruby-gem-on-centos-5-8
First, Centos 5.8 ships with gcc 4.1.4, but to compile libv8 you need 4.4. Luckily, this step is easy:
$ yum install gcc44-c++
Next, you need to tell the build to make use of it. The easiest thing to do here, is to export a couple of environment variables:
$ export CC=/usr/bin/gcc44
$ export CXX=/usr/bin/g++44
Now if you attempt gem install libv8, you will get an error along the lines of:
$ gem install libv8
creating MakefileUsing compiler:/usr/bin/g++44Traceback(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 375with open(source_path)as source_file:^SyntaxError: invalid syntax
gmake:***[out/Makefile.x64]Error1
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
This is because the version of Python that is shipped with Centos is too old. Upgrading Python is not too hard, but be warned - do not under any circumstance replace the shipped Centos Python - lots of stuff depends on it, and it you replace it, lots of stuff will break.
To install Python 2.7:
$ yum install bzip2
$ yum install bzip2-devel
$ wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz
$ tar -xf Python-2.7.3.tgz
$ cd Python-2.7.3
$ ./configure
$ make
$ make altinstall
The final step is very important - this stops it overwriting the default Centos Python. We are on the home straight now. To get the libv8 install to use Python 2.7 instead of Python 2.4, I thought I could create a symlink in my local directory, and then slip my local directory onto the front of my path:
$ ln -s /usr/local/bin/python2.7 python
$ export PATH=.:$PATH
$ python --version
Python2.7.3
However, that didn't work.
I don't know why - maybe the Makefile explicitly references /usr/bin/python? What I did was move the existing Python executable out of the way, and symlink the Python 2.7 in its place:
$ mv /usr/bin/python /usr/bin/python_
$ ln -s /usr/local/bin/python2.7/usr/bin/python
Finally:
$ gem install libv8
( about 5 minutes later)Buildingnative extensions.This could take a while...Successfully installed libv8-3.11.8.41 gem installed
Installing ri documentation for libv8-3.11.8.4...InstallingRDoc documentation for libv8-3.11.8.4...
Now remember, to put Python back the way you found it:
$ rm /usr/bin/python
$ mv /usr/bin/python_ /usr/bin/python
Job done - finally.
【转】Installing the libv8 Ruby gem on Centos 5.8的更多相关文章
- Ruby Gem命令详解
转自:http://www.jianshu.com/p/728184da1699 Gem介绍: Gem是一个管理Ruby库和程序的标准包,它通过Ruby Gem(如 http://rubygems.o ...
- Ruby Gem命令
Gem是一个管理Ruby库和程序的标准包,它通过Ruby Gem(如 http://rubygems.org/ )源来查找.安装.升级和卸载软件包,非常的便捷. Ruby 1.9.2版本默认已安装Ru ...
- ruby gem tips(转)
淘宝源: https://ruby.taobao.org 升级ruby gem gem update --system 查看gem版本 gem -v 查看gem版本,gems安装目录,remote s ...
- Installing MySQL 5.7.23 on CentOS 7
Installing MySQL 5.7.23 on CentOS 7 1. 安装前检查 1.1 检查NUMA是否开启 NUMA为什么要咋MySQL中禁用? MySQL是单进程多线程架构数据库,当nu ...
- bundler简介(ruby gem)
簡介 Bundler RubyGem 是包裝.散佈Ruby程式庫的標準方式,相關文件可以參考 RubyGems Guides 的說明,或是 簡介 plugins 中的第二個例子.在使用rails ...
- ruby gem install rails 错误解决
最近打算看ruby. 今天用命令gem install rails的时候碰到这样的错误提示: ERROR: Error installing XXXXXXXXXXX: The ...
- ruby(&gem) koala安装
1.ruby下载安装 下载地址:http://railsinstaller.org/en 选择合适版本 2.gem(安装ruby时自带gem) 删除原镜像:gem sources --remove h ...
- 转 关于ruby gem无法连接到rubygems.org的解决方案
为什么有这个? 由于国内网络原因(你懂的),导致 rubygems.org 存放在 Amazon S3 上面的资源文件间歇性连接失败.所以你会与遇到 gem install rack 或 bundle ...
- 修改ruby gem源为ruby.taobao.org
由于网络原因,导致从rubygems.org下载gem文件较慢或者间歇性的连接失败,所以可以修改gem源为ruby.taobao.org.具体可以用 gem install rails -V 来查看执 ...
随机推荐
- ORACLE 远程连接数据库
通过运行->cmd->sqlplus/nolog 登录sqlplus时,突然间提示“sqlplus不是内部或外部命令,也不 是可运行的程序或批处理文件”,如下图: 分析后感觉不可能啊,因为 ...
- java classpath、path用法
java环境配置classpath和path变量的作用: path:指定cmd中命令执行文件所在的路径.比如javac.java两个可执行文件在jdk的bin目录下,如果path值含有这个bin目录, ...
- AFNetworking速成教程
转:http://palmsky.net/?p=4138 本文是由 iOS Tutorial 小组成员 Scott Sherwood撰写,他是一个基于位置动态加载(Dynamically Loaded ...
- 在英文 sql2005中 比较nvarchar 与 varchar的速度
declare @str1 varchar(max); declare @count int; ; print 'begin' begin set @str1 = @str1 + '*'; ; end ...
- [Papers]NSE, $\p_3u$, Lebesgue space [Kukavica-Ziane, JMP, 2007]
$$\bex \p_3\bbu\in L^p(0,T;L^q(\bbR^3)),\quad \frac{2}{p}+\frac{3}{q}=2,\quad \frac{9}{4}\leq q\leq ...
- .net-C#代码判断
ylbtech-doc:.net-C#代码判断 C#代码判断 1.A,C#代码判断返回顶部 01.{ C#题目}public static void Main(string[] args){ ...
- 翻译【ElasticSearch Server】第一章:开始使用ElasticSearch集群(4)
停止ElasticSearch(Shutting down ElasticSearch) 尽管我们期望集群(或节点)终生完美运行,我们最终可能需要重启或者正确的停止它(例如,维护).有三种方式来停止E ...
- IOS UINavigationController 操作相关集合
1.修改中间Title字体以及大小 [self.navigationController.navigationBar setTitleTextAttributes:[NSDictionary dict ...
- python easy_install centos 下安装过程和原理解析
一.easy_install 安装过程 其安装过程有很多种,我也找了很多的例子,但是结果都不太好,以下方法的结果是不错的. easy_install与yum类似,使用easy_install,可以轻松 ...
- 用matlab绘制幂函数
用matlab绘制幂函数 下周轮到我做论文汇报了,刚好前两天看了网格水印的文章,就决定汇报前两天看到的那篇论文了.在准备ppt的过程中,绘制了一些幂函数,感觉matlab真的是很强大啊,可以绘制各种曲 ...