如果你的系统是 Mac OS,因为 Mac OS 是内置 Ruby 的,至少 Ruby 就不是问题了。这
时,最简单的办法是用 Homebrew (
http://brew.sh/index_zh-cn.html
)等包管理软件进
行 Ruby 的升级和 Gnuplot 的安装。安装 Homebrew 之后,在终端中执行
brew update
brew install ruby
即可更新到最新的 Ruby。接下来,
brew install gnuplot --with-x11
即可安装好 Gnuplot。这里特别提醒,对于 OS X Yosemite(10.10)版本之后的用户,强烈
建议加上“--with-x11”选项以防之后出现图像显示不出的问题。
如果你喜欢自己下载源代码自己编译,我相信你应该不会有上述提到的问题。只是对
于 OS X Yosemite(10.10)版本之后的系统,Gnuplot 在编译时,可能需要修改一下配置文
件。需要在源代码的“configure”中加入 x11 的位置如下:
# Standard set of common directories for X headers.
# Check X11 before X11Rn because it is often a symlink to the current release.
---added the location of my X11 files also
/opt/X11/include