【问题标题】:Doing git pull in Engine Yard在引擎场做 git pull
【发布时间】:2014-05-27 11:32:53
【问题描述】:

我正在将我的 rails 应用程序部署到 Engine Yard。

到目前为止我所拥有的: 1.创建SSH嘿嘿 2. 将公钥安装到Engine Yard 应用程序。 3. ssh deploy@my.server.ip.address

我被安置在 home/deploy,这不是执行 git pull 的正确位置。

之所以需要这样部署,是因为我的应用使用的是nmatrix gem,需要使用c++编译器手动安装。自动打包程序在获取该 gem 时出错,并停止。

更新: 我想我的问题应该是,如何将 nmatrix 安装到 EngineYard。这是我调用 gem install nmatrix 得到的错误消息:

Building native extensions.  This could take a while...
ERROR:  Error installing nmatrix:
    ERROR: Failed to build gem native extension.

    /usr/bin/ruby21 extconf.rb
checking for main() in -llapack... no
checking for main() in -lcblas... yes
checking for main() in -latlas... no
checking for clapack.h... no
checking for cblas.h... yes
checking for cblas.h... yes
checking for clapack_dgetrf() in cblas.h,clapack.h... no
checking for clapack_dgetri() in cblas.h,clapack.h... no
checking for dgesvd_() in clapack.h... no
checking for cblas_dgemm() in cblas.h... yes
using C++ standard... c++0x
g++ reports version... Hardened
creating nmatrix_config.h
creating Makefile

make "DESTDIR="
compiling nmatrix.cpp
In file included from nmatrix.cpp:331:0:
ruby_nmatrix.c: In function ‘VALUE nm_mset(int, VALUE*, VALUE)’:
ruby_nmatrix.c:1378:108: warning: format ‘%u’ expects type ‘unsigned int’, but argument 4 has type ‘size_t’
ruby_nmatrix.c: In function ‘VALUE nm_xslice(int, VALUE*, void* (*)(const STORAGE*, SLICE*), void (*)(NMATRIX*), VALUE)’:
ruby_nmatrix.c:1556:91: warning: format ‘%u’ expects type ‘unsigned int’, but argument 4 has type ‘size_t’
ruby_nmatrix.c: In function ‘SLICE* get_slice(size_t, int, VALUE*, size_t*)’:
ruby_nmatrix.c:1903:104: warning: format ‘%u’ expects type ‘unsigned int’, but argument 3 has type ‘size_t’
ruby_nmatrix.c:1903:104: warning: format ‘%u’ expects type ‘unsigned int’, but argument 4 has type ‘size_t’
compiling ruby_constants.cpp
compiling data/data.cpp
compiling util/io.cpp
compiling math.cpp
In file included from math.cpp:140:0:
math/rot.h: In function ‘void nm::math::rot(int, DType*, int, DType*, int, CSDType, CSDType) [with DType = nm::Complex<float>, CSDType = float]’:
math/rot.h:123:40: error: ‘cblas_csrot’ was not declared in this scope
math/rot.h: In function ‘void nm::math::rot(int, DType*, int, DType*, int, CSDType, CSDType) [with DType = nm::Complex<double>, CSDType = double]’:
math/rot.h:128:40: error: ‘cblas_zdrot’ was not declared in this scope
In file included from math.cpp:141:0:
math/rotg.h: In function ‘void nm::math::rotg(DType*, DType*, DType*, DType*) [with DType = nm::Complex<float>]’:
math/rotg.h:99:125: error: ‘cblas_crotg’ was not declared in this scope
math/rotg.h: In function ‘void nm::math::rotg(DType*, DType*, DType*, DType*) [with DType = nm::Complex<double>]’:
math/rotg.h:104:125: error: ‘cblas_zrotg’ was not declared in this scope
make: *** [math.o] Error 1


Gem files will remain installed in /home/deploy/.gem/ruby/2.1.0/gems/nmatrix-0.0.9 for inspection.
Results logged to /home/deploy/.gem/ruby/2.1.0/gems/nmatrix-0.0.9/ext/nmatrix/gem_make.out

安装 nmatrix 的先决条件之一是 gcc > v4.7,但 EngineYard 只有 v4.5.4。有人知道如何升级 gcc 吗?我想我正在运行 Gentoo。

【问题讨论】:

  • 您能否发布更多关于 Bundler 尝试获取 gem 时出现的错误的信息?您指定了哪个版本的 NMatrix?请发布这些信息,我们或许可以为您提供帮助。

标签: deployment engineyard nmatrix


【解决方案1】:

问题实际上应该包括 what 你想要 git pull。

当你 ssh 进入时,你会进入 /home/deploy 这是你的主目录。

您的应用的 Git 副本位于 App Master 上的 /data/APPNAME/shared/cache-copy/

您可以在一个实例上拥有多个应用程序,每个应用程序可以有不同的部署密钥,因此您可以使用 GIT_SSH 包装器

GIT_SSH=/data/APPNAME/shared/config/pulse-ssh-wrapper git pull

(在所有上述命令中,请记住将 APPNAME 替换为应用程序使用的名称)

如果您想找到捆绑 gem 的实际位置,可以查看

/data/APPNAME/shared/bundled_gems/ruby/2.0.0/gems(版本取决于 Ruby ABI)

如果您的 Gemfile 使用 :git,请记住只有一个部署密钥可用于应用程序克隆和捆绑阶段,您不能为每个 gem 选择不同的密钥。

安装 nmatrix gem 的问题很可能是尚未安装 ATLAS 库,这些库将使用系统的包管理器(Gentoo 的 Portage 和 Ubuntu 的 Apt-get)安装。您可以通过 UI 上的“Edit Unix Packages”添加它们,只需选择 sci-libs/blas-atlas 和 sci-libs/lapack-atlas。目前这将失败,因为 EC2 实例是 Xeon 处理器,而库尚未在这些处理器上构建。

您可以使用“cat /proc/cpuinfo”查看 Linux 实例上的 CPU 类型,并会看到类似

model name  :Intel(R) Xeon(R) CPU E5-2650 0 @ 2.00GHz

【讨论】:

  • 在向 Engine Yard 工程师发送了几天的电子邮件后,他们似乎为我解决了问题。硬件相关问题确实影响了安装。我没有得到 nmatrix-0.0.9,而是得到 0.1.0.rc3
猜你喜欢
  • 2022-01-20
  • 1970-01-01
  • 1970-01-01
  • 2018-01-03
  • 2012-12-22
  • 1970-01-01
  • 1970-01-01
  • 2014-12-01
  • 2020-03-25
相关资源
最近更新 更多