我正在尝试将我的 Ruby on Rails 应用程序推送到 OpenShift,但是 gem 文件 bcrypt 出了点问题。本地一切正常,就在我尝试在 Openshift 端运行时发生此错误。
没有要加载的文件 - bcrypt (LoadError) /var/lib/openshift/548f13fce0b8cdf18c000001/app-root/runtime/repo/vendor/bundle/ruby/gems/activesupport-4.1.1/lib/active_support/dependencies.rb: 247:in
require' /var/lib/openshift/548f13fce0b8cdf18c000001/app-root/runtime/repo/vendor/bundle/ruby/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in
块中的要求'/var/lib/openshift/548f13fce0b8cdf18c000001/app-root/runtime/repo/vendor/bundle/ruby/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:232:inload_dependency' /var/lib/openshift/548f13fce0b8cdf18c000001/app-root/runtime/repo/vendor/bundle/ruby/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in
要求' /var/lib/openshift/548f13fce0b8cdf18c000001/app-root/runtime/repo/vendor/bundle/ruby/gems/activemodel-4.1.1/lib/active_model/secure_password.rb:49:inhas_secure_password' /var/lib/openshift/548f13fce0b8cdf18c000001/app-root/runtime/repo/app/models/user.rb:13:in
' /var/lib/openshift /548f13fce0b8cdf18c000001/app-root/runtime/repo/app/models/user.rb:1:in<top (required)>' /var/lib/openshift/548f13fce0b8cdf18c000001/app-root/runtime/repo/vendor/bundle/ruby/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in
需要'/var/lib/openshift/548f13fce0b8cdf18c000001/app-root/runtime/repo/vendor/bundle/ruby/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:inblock in require' /var/lib/openshift/548f13fce0b8cdf18c000001/app-root/runtime/repo/vendor/bundle/ruby/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:232:in
load_dependency'/var/lib /openshift/548f13fce0b8cdf18c000001/app-root/runtime/repo/vendor/bundle/ruby/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:inrequire' /var/lib/openshift/548f13fce0b8cdf18c000001/app-root/runtime/repo/vendor/bundle/ruby/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:348:in
require_or_load' /var/lib/openshift/548f13fce0b8cdf18c000001/app -root/runtime/repo/vendor/bundle/ruby/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:307:independ_on' /var/lib/openshift/548f13fce0b8cdf18c000001/app-root/runtime/repo/vendor/bundle/ruby/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:225:in
require_dependency' /var/lib/openshift/548f13fce0b8cdf18c000001/app-root/runtime/repo /vendor/bundle/ruby/gems/railties-4.1.1/lib/rails/engine.rb:468:inblock (2 levels) in eager_load!' /var/lib/openshift/548f13fce0b8cdf18c000001/app-root/runtime/repo/vendor/bundle/ruby/gems/railties-4.1.1/lib/rails/engine.rb:467:in
每个'/var/lib/openshift/548f13fce0b8cdf18c000001/app-root/runtime/repo/vendor/bundle/ruby/gems/railties-4.1.1/lib/rails/engine.rb:467:inblock in eager_load!' /var/lib/openshift/548f13fce0b8cdf18c000001/app-root/runtime/repo/vendor/bundle/ruby/gems/railties-4.1.1/lib/rails/engine.rb:465:in
each'/var/lib /openshift/548f13fce0b8cdf18c000001/app-root/runtime/repo/vendor/bundle/ruby/gems/railties-4.1.1/lib/rails/engine.rb:465:ineager_load!' /var/lib/openshift/548f13fce0b8cdf18c000001/app-root/runtime/repo/vendor/bundle/ruby/gems/railties-4.1.1/lib/rails/engine.rb:346:in
eager_load!/var/lib/openshift/548f13fce0b8cdf18c000001/app-root/runtime/repo/vendor/bundle/ruby/gems/railties-4.1.1/lib/rails/application/finisher.rb:58:ineach' /var/lib/openshift/548f13fce0b8cdf18c000001/app-root/runtime/repo/vendor/bundle/ruby/gems/railties-4.1.1/lib/rails/application/finisher.rb:58:in
block in ' /var/ lib/openshift/548f13fce0b8cdf18c000001/app-root/runtime/repo/vendor/bundle/ruby/gems/railties-4.1.1/lib/rails/initializable.rb:30:ininstance_exec' /var/lib/openshift/548f13fce0b8cdf18c000001/app-root/runtime/repo/vendor/bundle/ruby/gems/railties-4.1.1/lib/rails/initializable.rb:30:in
run' /var/lib/openshift/548f13fce0b8cdf18c000001/ app-root/runtime/repo/vendor/bundle/ruby/gems/railties-4.1.1/lib/rails/initializable.rb:55:inblock in run_initializers' /opt/rh/ruby200/root/usr/share/ruby/tsort.rb:150:in
阻止 tsort_each' /opt/rh/ruby200/root/usr/share/ruby/tsort.rb:183:inblock (2 levels) in each_strongly_connected_component' /opt/rh/ruby200/root/usr/share/ruby/tsort.rb:219:in
each_strongly_connected_component_from' /opt/rh/ruby200/root/usr/share/ruby/tsort.rb:182:inblock in each_strongly_connected_component' /opt/rh/ruby200/root/usr/share/ruby/tsort.rb:180:in
每个' /opt/rh/ruby200/root/usr/share/ruby/tsort.rb:180:ineach_strongly_connected_component' /opt/rh/ruby200/root/usr/share/ruby/tsort.rb:148:in
tsort_each' /var/lib/openshift/548f13fce0b8cdf18c000001/app-root/runtime/repo/vendor/bundle/ruby/gems /railties-4.1.1/lib/rails/initializable.rb:54:inrun_initializers' /var/lib/openshift/548f13fce0b8cdf18c000001/app-root/runtime/repo/vendor/bundle/ruby/gems/railties-4.1.1/lib/rails/application.rb:288:in
初始化!/var/lib/openshift/548f13fce0b8cdf18c000001/app-root/runtime/repo/config/environment.rb:5:in<top (required)>' config.ru:1:in
require' config.ru:1:inblock in <main>' /var/lib/openshift/548f13fce0b8cdf18c000001/app-root/runtime/repo/vendor/bundle/ruby/gems/rack-1.5.2/lib/rack/builder.rb:55:in
instance_eval' /var/lib/openshift/548f13fce0b8cdf18c000001/app-root/运行时/repo/vendor/bundle/ruby/gems/rack-1.5.2/lib/rack/builder.rb:55:ininitialize' config.ru:1:in
new' config.ru:1:in<main>' /opt/rh/ruby200/root/usr/share/gems/gems/passenger-4.0.18/helper-scripts/rack-loader.rb:78:in
eval' /opt/rh/ruby200/root/usr/share/gems/gems/passenger-4.0.18/helper-scripts/rack-loader.rb:78:inload_app' /opt/rh/ruby200/root/usr/share/gems/gems/passenger-4.0.18/helper-scripts/rack-loader.rb:96:in
' /opt/rh/ruby200/root/usr/共享/gems/gems/passenger-4.0.18/helper-scripts/rack-loader.rb:4:in<module:PhusionPassenger>' /opt/rh/ruby200/root/usr/share/gems/gems/passenger-4.0.18/helper-scripts/rack-loader.rb:3:in
'
我最新的宝石文件:
源' https://rubygems.org '
...
gem 'bcrypt'
gem 'bcrypt-ruby'
...
我的 Gemfile.lock 包含所需的所有依赖项。
要知道的一个重要事实是,推送修改后的 Openshift 控制台不会安装 gem 文件 bcrypt 和 bcrypt-ruby。跟随 optput
远程:停止 Ruby 墨盒
远程:修复 1 个部署的链接
远程:启用强制清理构建 - 清理依赖
项远程:构建 git ref 'master',提交 cab854c
远程:构建 Ruby 墨盒
远程:捆绑安装 --deployment --path ./app -root/repo/vendor/bundle
remote:注意:您可以使用以下命令阻止安装某些 Gemfile 组:rhc env set
BUNDLE_WITHOUT=groupname remote:从https://rubygems.org/
获取 gem 元数据........ 远程:安装rake(10.4.2) 远程:安装i18n(0.6.11) 远程:安装json(1.8.1) 远程:安装minitest(5.5.0)
远程:安装thread_safe(0.3.4)
远程:安装tzinfo(1.2.2)
远程:安装activesupport(4.1.1)
远程:安装builder(3.2.2)
远程:安装erubis(2.7.0)
远程:安装actionview( 4.1.1)
远程:安装机架(1.5.2)
远程:安装机架测试(0.6.2)
远程:安装actionpack(4.1.1)
远程:安装mime-types(1.25.1)
远程:安装多语言(0.3 .5)
远程:安装树顶(1.4.15)
远程:安装邮件(2.5.4)
远程:安装actionmailer(4.1.1)
远程:安装activemodel(4.1.1)
远程:安装arel(5.0.1.20140414130214)
远程:安装activerecord(4.1.1)
远程:安装execjs(2.2.2)
远程:安装autoprefixer-rails(4.0.2.1)
远程:安装sass(3.2.19)
远程:安装bootstrap-sass(3.3.1.0)
远程:安装bootstrap_form(2.2.0)
远程:安装子进程(0.5.5)
远程:安装咖啡脚本源(1.8.0)
远程:安装咖啡脚本(2.3.0)
远程:安装雷神(0.19.1)
远程:安装 railties (4.1.1)
远程:安装 coffee-rails (4.0.1)
远程:安装远足 (1.2.3)
远程:安装 multi_xml (0.5.5)
远程:安装 httparty (0.13.3)
远程:安装 multi_json (1.10.1)
远程:安装 jbuilder (2.2.5)
远程:安装 jquery-rails (3.1.2)
远程:安装 mysql2 (0.3.17)
远程:使用捆绑器 (1.3.5)
远程:安装倾斜(1.4.1)
遥控器:安装链轮(2.11.0)
遥控器:安装链轮导轨(2.2.2)
遥控器:安装导轨(4.1.1)
遥控器:安装rdoc(4.2.0)
遥控器:安装rubyzip(0.9 ) .9)
远程:安装 sass-rails (4.0.5)
远程:安装 sdoc (0.4.1)
远程:安装 websocket (1.0.7)
远程:安装 selenium-webdriver (2.35.1)
远程:安装 turbolinks (2.5. 3)
远程:安装 uglifier (2.6.0)
远程:安装 validates_cpf_cnpj (0.2.0)
远程:冻结时无法写入更改的锁定文件。
远程:您的捆绑包已完成!
远程:它已安装到 ./vendor/bundle
远程:来自 httparty 的安装后消息:
远程:当您使用 HTTParty 时,您必须全力以赴!
远程:来自 rdoc 的安装后消息:
远程:根据您的 ruby 版本,您可能需要安装 ruby rdoc/ri 数据:
远程:
远程:<= 1.8.6:不支持
远程:= 1.8.7:gem install rdoc -数据; rdoc-data --install
remote: = 1.9.1 : gem install rdoc-data; rdoc-data --install
remote: >= 1.9.2 : 无事可做!耶!
远程:准备构建以进行部署
显然错误是因为没有安装 gem 文件,但问题是为什么?