我正在升级Heroku上的生产应用程序到雪松-14。我对我的暂存应用heroku fork -a v-upgrade v-upgrade2进行了分叉,验证了分叉版本在Cedar-10上已经启动并运行,将堆栈设置为Cedar-14,创建了一个虚拟提交,并在推送接收到以下内容时:
~/documents/coding/cycling/velopro$ git push upgrade2 currentdev:master
Counting objects: 11833, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (7014/7014), done.
Writing objects: 100% (11833/11833), 91.20 MiB | 1.05 MiB/s, done.
Total 11833 (delta 8521), reused 6407 (delta 4535)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Fetching custom git buildpack... done
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.2.0
remote: -----> Installing gsl
remote: -----> Installing dependencies using 1.9.7
remote: Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
remote: Could not load OpenSSL.
remote: You must recompile Ruby with OpenSSL support or change the sources in your
remote: Gemfile from 'https' to 'http'. Instructions for compiling with OpenSSL using
remote: RVM are available at rvm.io/packages/openssl.
remote: Bundler Output:
remote: Could not load OpenSSL.
remote: You must recompile Ruby with OpenSSL support or change the sources in your
remote: Gemfile from 'https' to 'http'. Instructions for compiling with OpenSSL using
remote: RVM are available at rvm.io/packages/openssl.
remote: !
remote: ! Failed to install gems via Bundler.
remote: !
remote:
remote: ! Push rejected, failed to compile Ruby app
remote:
remote: Verifying deploy....
remote:
remote: ! Push rejected to v-upgrade2.
remote:
To git@heroku.com:v-upgrade2.git
! [remote rejected] currentdev -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:v-upgrade2.git'我再次确认,我仍然可以在Heroku上推出原始的分阶段应用程序(v升级),所以它们之间唯一的区别似乎是雪松堆栈。
有没有其他人在雪松-14上遇到过装载OpenSSL的问题?有没有办法在Heroku上“用OpenSSL支持重新编译”?
提前感谢您的帮助!
发布于 2015-08-21 23:45:36
最后,我划船了。我使用的buildpack已经有一段时间没有更新了,所以我没有尝试修复它,我只是分了heroku-buildpack-ruby并添加了几行代码来包含我需要的GSL库,如下所示:
/Rakefile
+ GSL_VENDOR_URL = "https://s3.amazonaws.com/gsl_bin/gsl-1.15.tgz"/lib/language_pack/ruby.rb
class LanguagePack::Ruby < LanguagePack::Base
+ GSL_VENDOR_URL = "https://s3.amazonaws.com/gsl_bin/gsl-1.15.tgz"
NAME = "ruby"
LIBYAML_VERSION = "0.1.6"
LIBYAML_PATH = "libyaml-#{LIBYAML_VERSION}"
@@ -57,7 +58,8 @@ class LanguagePack::Ruby < LanguagePack::Base
def default_config_vars
instrument "ruby.default_config_vars" do
vars = {
- "LANG" => env("LANG") || "en_US.UTF-8"
+ "LANG" => env("LANG") || "en_US.UTF-8",
+ "LD_LIBRARY_PATH" => ld_path,
}
ruby_version.jruby? ? vars.merge({
@@ -88,6 +90,9 @@ class LanguagePack::Ruby < LanguagePack::Base
setup_export
setup_profiled
allow_git do
+ install_gsl
+ run("cp -R vendor/gsl-1 /app/vendor/gsl")
+ run("cp -R vendor/gsl-1 /app/vendor/gsl-1")
install_bundler_in_app
build_bundler
post_bundler
@@ -111,6 +116,7 @@ private
paths = [
ENV["PATH"],
"bin",
+ "/app/vendor/gsl-1/bin",
system_paths,
]
paths.unshift("#{slug_vendor_jvm}/bin") if ruby_version.jruby?
@@ -119,6 +125,10 @@ private
paths.join(":")
end
+ def ld_path
+ "/app/vendor/gsl-1/lib"
+ end
+
def binstubs_relative_paths
[
"bin",
@@ -459,6 +469,15 @@ ERROR
FileUtils.rm File.join('bin', File.basename(path)), :force => true
end
+ def install_gsl
+ topic("Installing gsl")
+ bin_dir = "vendor/gsl-1"
+ FileUtils.mkdir_p bin_dir
+ Dir.chdir(bin_dir) do |dir|
+ run("curl #{GSL_VENDOR_URL} -s -o - | tar xzf -")
+ end
+ end最后,虽然找出加载OpenSSL的错误在情感上可能不那么令人满意,但无论如何,这可能是更好的途径。
https://stackoverflow.com/questions/31861833
复制相似问题