在Heroku上部署应用程序时,不应用BUNDLE_
我的目标是在Heroku上部署一个应用程序,用于“Heroku_生产”环境 我的文件如下所示:在Heroku上部署应用程序时,不应用BUNDLE_,heroku,config,Heroku,Config,我的目标是在Heroku上部署一个应用程序,用于“Heroku_生产”环境 我的文件如下所示: source 'https://rubygems.org' gem 'rails', '3.2.9' # Bundle edge Rails instead: # gem 'rails', :git => 'git://github.com/rails/rails.git' group :development, :test, :production do gem 'sqlite3'
source 'https://rubygems.org'
gem 'rails', '3.2.9'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
group :development, :test, :production do
gem 'sqlite3'
end
# This is needed in case this app is deployed in Heroku - in order to make the Heroku deployment independent from the production environment
group :heroku_production do
gem 'pg'
end
...
我将BUNDLE_不带变量设置为“development:test:production”。以下是调用heroku配置--app my_app时的输出:
=== my_app Config Vars
BUNDLE_WITHOUT: development:test:production
DATABASE_URL: postgres://XXXXXXX....
HEROKU_POSTGRESQL_CYAN_URL: postgres://XXXXXXX....
RACK_ENV: heroku_production
RAILS_ENV: heroku_production
但是,当我将我的东西推送到Heroku时,没有var的BUNDLE_不会被应用,正如您在下面的错误消息中所看到的(第3行:--没有开发:测试):
赫罗库为什么要这样做?谷歌搜索也帮不了什么忙 请注意-目前,Cedar stack不支持没有的BUNDLE_
发件人:我最近就这个问题联系了Heroku,他们说BUNDLE\u现在可以用了 以下是我得到的答复: 嗨, 不推荐使用user_env_compile,但它的功能刚刚成为Ruby buildpack的默认功能-因此您可以在不使用config var的情况下使用BUNDLE_。 我相信你看过这篇文章,但这是正确的吗? 看来我们需要更新那个文档了! 最好的, [姓名修订]
还没有尝试过,但很快就会尝试。谢谢您的回答!有人知道Heroku是否正在努力解决这个问题吗?杰拉尔多
-----> Ruby/Rails app detected
-----> Installing dependencies using Bundler version 1.3.2
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin --deployment
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/..
Using rake (10.0.4)
...
Using pg (0.14.1)
Installing sqlite3 (1.3.7)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb
checking for sqlite3.h... no
sqlite3.h is missing. Try 'port install sqlite3 +universal'
or 'yum install sqlite-devel' and check your shared library search path (the
location where your sqlite3 shared library is located).
*** extconf.rb failed ***
An error occurred while installing sqlite3 (1.3.7), and Bundler cannot continue.
Make sure that `gem install sqlite3 -v '1.3.7'` succeeds before bundling.
!
! Failed to install gems via Bundler.
!
! Heroku push rejected, failed to compile Ruby/rails app
To git@heroku.com:my_app.git
! [remote rejected] 3dac67374c268d3bf9e051a6db39efc56ae81c76 -> master (pre-receive hook declined)