我是一个新手,在使用 django 和 rpy2 在 Heroku 上工作时,我的能力已经达到了极限。特别是,我正在尝试测试 rpy2 创建的并发漏洞,以查看 Heroku 是否可以防止它(通过 dyno 隔离?)。
部署 django 示例很好,但添加 rpy2 会遇到不满意的 R 依赖项
git push heroku master
Counting objects: 11, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (9/9), done.
Writing objects: 100% (11/11), 3.97 KiB, done.
Total 11 (delta 0), reused 0 (delta 0)
-----> Python app detected
-----> No runtime.txt provided; assuming python-2.7.3.
-----> Preparing Python runtime (python-2.7.3)
-----> Installing Distribute (0.6.34)
-----> Installing Pip (1.2.1)
-----> Installing dependencies using Pip (1.2.1)
Downloading/unpacking Django==1.5 (from -r requirements.txt (line 1))
Running setup.py egg_info for package Django
Downloading/unpacking argparse==1.2.1 (from -r requirements.txt (line 2))
Running setup.py egg_info for package argparse
no previously-included directories found matching 'doc/_build'
no previously-included directories found matching 'env24'
no previously-included directories found matching 'env25'
no previously-included directories found matching 'env26'
no previously-included directories found matching 'env27'
Downloading/unpacking rpy2==2.3.4 (from -r requirements.txt (line 3))
Running setup.py egg_info for package rpy2
sh: R: not found
Error: Tried to guess R's HOME but no R command in the PATH.
Complete output from command python setup.py egg_info:
running egg_info
creating pip-egg-info/rpy2.egg-info
writing pip-egg-info/rpy2.egg-info/PKG-INFO
writing top-level names to pip-egg-info/rpy2.egg-info/top_level.txt
writing dependency_links to pip-egg-info/rpy2.egg-info/dependency_links.txt
writing manifest file 'pip-egg-info/rpy2.egg-info/SOURCES.txt'
warning: manifest_maker: standard file '-c' not found
sh: R: not found
Error: Tried to guess R's HOME but no R command in the PATH.
----------------------------------------
Command python setup.py egg_info failed with error code 1 in /app/build/rpy2
Storing complete log in /app/.pip/pip.log
! Heroku push rejected, failed to compile Python app
To git@heroku.com:infinite-plateau-7086.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:infinite-plateau-7086.git'
添加 init.r 导致 Heroku 识别 R 应用程序并启动 R
$ git push heroku master
Counting objects: 13, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (11/11), done.
Writing objects: 100% (13/13), 4.15 KiB, done.
Total 13 (delta 1), reused 0 (delta 0)
-----> Fetching custom git buildpack... done
-----> R app detected
Vendoring R 2.15.1
Downloading and unpacking R binaries
Executing init.r script
R 2.15.1 successfully installed
-----> Discovering process types
-----> Compiled slug size: 96.7MB
-----> Launching... done, v5
http://infinite-plateau-7086.herokuapp.com deployed to Heroku
To git@heroku.com:infinite-plateau-7086.git
* [new branch] master -> master
但是无论有没有init.r文件,应用程序识别都看不到django with R up
$ git push heroku master
Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 289 bytes, done.
Total 3 (delta 2), reused 0 (delta 0)
-----> Fetching custom git buildpack... done
! Heroku push rejected, no Cedar-supported app detected
To git@heroku.com:infinite-plateau-7086.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:infinite-plateau-7086.git'
我正在使用r buildpack和multi buildpack来允许 r django 交互。任何人都知道如何解决上述依赖冲突(因为我最终想将两者一起使用),或者 R 和 python 交互是否无法在 Heroku 上安全扩展?