【发布时间】:2014-06-29 08:19:37
【问题描述】:
我的目录结构如下:
my-app/
.git/
db/ <-- Database stuff
lib/ <-- Business logic
spec/
web/ <-- Rails
Rails 位于存储库的 web/ 子目录中。 Heroku 默认不喜欢这个。
我有一个partially working heroku buildpack。它基本上在运行任何任务之前调用Dir.chdir 更改为APP_SUBDIR 环境变量(如果存在)。
我想部署到 Heroku,但我无法让资产管道任务工作。当需要预编译资产时,自定义的 buildpack 会更改为 web/ 目录并尝试运行任务。
然而,I get this error,有以下重要的一点:
Could not detect rake tasks
ensure you can run `$ bundle exec rake -P` against your app with no environment variables present
and using the production group of your Gemfile.
Your Ruby version is 1.9.2, but your Gemfile specified 2.0.0 (Bundler::RubyVersionMismatch)
这很奇怪,因为 Heroku 明确表示我在同一个馅饼中运行 2.0。事实上,当我运行时:
$ heroku run 'cd web; bundle exec rake -P'
它工作得很好。
TL;DR(摘要)
Heroku 认为我的 ruby 版本是 1.9.2,而实际上是 2.0.0 shown in its own build process。为什么会这样?
【问题讨论】:
-
本打算建议更改您的 buildpack,但您似乎已经这样做了!
标签: ruby-on-rails heroku deployment asset-pipeline buildpack