当我使用Neo4j时,Heroku认为我的Padrino应用程序是Rails

时间:2015-03-16 02:54:54

标签: ruby heroku deployment neo4j padrino

我使用的很多堆栈都比较新,并且遇到了部署到Heroku的问题。

我希望这是一件简单的事情,因为我对Heroku不是很熟悉,即使我已经搜索过StackOverflow,Heroku的网站,谷歌以及我能想到的其他任何地方但没有快乐。

问题在于:

  1. 我创建了一个本地Padrino应用
  2. 我使用git
  3. 直接部署到Heroku
  4. 它将它检测为Ruby / Rack应用程序,一切都很开心
  5. 我添加了宝石neo4jrb / neo4j
  6. 我再次部署
  7. 这次它认为它是一个Ruby / Rails应用程序并且不会运行
  8. 从我所能找到的Heroku使用config.ru文件检测Rack应用程序以及在Gemfile.lock中使用Rails来检测Rails应用程序。

    neo4j gem依赖于' railties'而这依赖于' actionpack'而这反过来依赖于“轨道 - 测试”测试'和' rails-html-sanitizer'。所以这两个轨道听起来都是Gemfile.lock。

    我的假设是首先发现检测Rails的尝试,它会在Gemfile.lock中看到一些与rails相关的项目,然后从那时起将其视为Rails应用程序。

    有没有办法告诉Heroku将其视为Rack应用程序,无论检测到什么?

    谢谢, GAV

1 个答案:

答案 0 :(得分:1)

有趣的是,当我在本地运行bundle时,我会遇到依赖冲突

Bundler could not find compatible versions for gem "rack":
  In Gemfile:
    neo4j (>= 0) ruby depends on
      railties (~> 4) ruby depends on
        actionpack (= 4.2.0) ruby depends on
          rack (~> 1.6.0) ruby

    padrino (= 0.12.5) ruby depends on
      padrino-core (= 0.12.5) ruby depends on
        rack (1.5.2)

Bundler could not find compatible versions for gem "activesupport":
  In Gemfile:
    neo4j (>= 0) ruby depends on
      railties (~> 4) ruby depends on
        activesupport (= 4.0.0) ruby

    padrino (= 0.12.5) ruby depends on
      padrino-core (= 0.12.5) ruby depends on
        activesupport (4.2.0)

因此,将铁路作为依赖性移除似乎是件好事。我刚刚将它更改为刚刚发布的4.1.5的gemspec文件中的development_dependency,因为它是我们的一个规范所需要的,但它不应该影响你。我只是尝试了它似乎工作。

最好有一个单独的neo4j-rails gem,它除了包含padrino支持之外还包含这些东西,但是可以实现。