[英]How can I update Python on Mac OS and have RubyGems use the new version?
I am having serious issues trying to download the "therubyracer" gem. 我在尝试下载“ therubyracer” gem时遇到严重问题。 I think the problem is that I do not have a working
libv8
library to create the gem. 我认为问题是我没有可以使用的
libv8
库来创建gem。
I think I do not have a working libv8
because my RubyGems keeps trying to use "Python 2.5.6", which is too old to gem install libv8
. 我想我没有一个
libv8
因为我的RubyGems一直尝试使用“ Python 2.5.6”,因为它太旧了,无法gem install libv8
。 I tried countless ways to update the Python that RubyGems uses, however, I cannot figure it out. 我尝试了无数种方法来更新RubyGems使用的Python,但是,我无法弄清楚。
Here is what I have done thus far. 到目前为止,这是我所做的。 I went to http://www.python.org/download/releases/3.3.2/ and downloaded "(Mac OS X 64-bit/32-bit Installer (3.3.2) for Mac OS X 10.6 and later 2.)".
我转到http://www.python.org/download/releases/3.3.2/并下载了“(针对Mac OS X 10.6及更高版本的Mac OS X 64位/ 32位安装程序(3.3.2)。 )”。
Upon completion of the download, I ran: 下载完成后,我运行了:
gem install libv8 --version 3.11.8.17
Yet, I still received the same error. 但是,我仍然收到相同的错误。 I noticed the output still said:
我注意到输出仍然说:
"Using Python 2.5.4"
Despite downloading a newer Python version, it is not being used. 尽管下载了更新的Python版本,但仍未使用它。 So how do I change the version of Python that the "gem" command uses?
那么,如何更改“ gem”命令使用的Python版本? I searched and discovered "virtualenv," which appears to be a good Python manager, however I am a bit at a dead end now.
我搜索并发现了“ virtualenv”,它似乎是一个不错的Python管理器,但是现在我有点死胡同了。 Any help or suggestion?
有什么帮助或建议吗?
If libv8 uses the python command from the command line, this should apply: 如果libv8从命令行使用python命令,则应适用:
If you do not care what python2 is installed, you can do this in the command line: 如果您不关心安装了什么python2,则可以在命令行中执行此操作:
type python # this gives you the path of the python command
python is /usr/bin/python
type python2.7
python is /usr/bin/python2.7
Then you can copy one over the other 然后,您可以将一个复制到另一个
cp /usr/bin/python2.7 /usr/bin/python
You can safely copy python2.7 there because it is compatible with older versions. 您可以安全地在其中复制python2.7,因为它与旧版本兼容。
Suggestions? 有什么建议吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.