【问题标题】:Install raspell gem on Heroku using Vulcan使用 Vulcan 在 Heroku 上安装 raspell gem
【发布时间】:2013-01-08 05:38:13
【问题描述】:

我想使用thinking-sphinx-raspell gem 来为我们网站上的搜索提供您的意思建议。它可以在我的开发机器(Mountain Lion)上运行,但我在 Heroku Cedar 上部署它时遇到了困难。

gem 依赖于raspell gem,而后者又依赖于aspell。因为 aspell 不包含在 Heroku Cedar 堆栈中,所以我使用 Vulcan 在 Heroku 机器上编译它,将二进制文件添加到我的 git 存储库,然后将其推送到 Heroku。我更详细地描述了这些步骤here

这会导致打包阶段出错:

Installing raspell (1.3)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb
checking for ruby.h... yes
checking for aspell.h... no
checking for main() in -laspell... no
creating Makefile
make
gcc -I. -I/usr/local/include/ruby-1.9.1/x86_64-linux -I/usr/local/include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -DHAVE_RUBY_H -I/opt/local/include    -fPIC -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long  -o raspell.o -c raspell.c
In file included from raspell.c:2:
raspell.h:6:20: error: aspell.h: No such file or directory

如果我理解正确的话,这种对 aspell.h 的依赖是在 raspell gem 的extconf.rb 中设置的:

have_header("aspell.h")

我将该头文件放在我项目的 bin 目录中。不是最好的地方,但我认为这不是问题所在。这对应于 Heroku 文件系统上的 /app/bin。我将此路径添加到PATHC_INCLUDE_PATHCPLUS_INCLUDE_PATH,并将CFLAGS 设置为-I/app/bin

我做错了什么?还是我在尝试一些对 Heroku 不起作用的东西?

【问题讨论】:

    标签: heroku gem aspell


    【解决方案1】:

    您是否查看过 Heroku 的构建包? https://devcenter.heroku.com/articles/buildpacks

    它们似乎是一种自定义堆栈的方法。 (可能是在您提出问题后才介绍的。)

    【讨论】:

      猜你喜欢
      • 2019-04-03
      • 1970-01-01
      • 2018-05-29
      • 2011-03-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-10-06
      相关资源
      最近更新 更多