Не удалось найти ruby-oci8 при развертывании приложения Rails с помощью Bundler

Не уверен, как идти об отладке этой ошибки. Развертывание этого приложения Rails на сервере разработки прошло успешно, но я получаю bundle stdout: Could not find ruby-oci8-2.2.0 in any of the sources (ошибка) при развертывании на рабочем сервере.

В сообщении об ошибке говорится, что не удается найти ruby-oci8 в наборе драгоценных камней? Любые идеи о том, как я могу отладить, почему развертывание не работает на рабочем сервере?

Я использую приведенные ниже Capistrano Gems

capistrano (3.4.0)
capistrano-bundler (1.1.4)
capistrano-file-permissions (0.1.1)
capistrano-rails (1.1.3)
capistrano-rvm (0.1.2)

Сокращенное сообщение от запуска: деплой шапки производства

** Invoke deploy:updated (first_time)
** Invoke bundler:install (first_time)
** Execute bundler:install
DEBUG [103a4281] Running /usr/bin/env if test ! -d /home/rails/apps/cals_db_sync/releases/20151020160801; then echo "Directory does not exist '/home/rails/apps/cals_db_sync/releases/20151020160801'" 1>&2; false; fi as [email protected]
DEBUG [103a4281] Command: if test ! -d /home/rails/apps/cals_db_sync/releases/20151020160801; then echo "Directory does not exist '/home/rails/apps/cals_db_sync/releases/20151020160801'" 1>&2; false; fi
DEBUG [103a4281] Finished in 0.006 seconds with exit status 0 (successful).
INFO [60676e5b] Running /usr/local/rvm/bin/rvm ruby-2.1.6@cals_db_sync do bundle install --path /home/rails/apps/cals_db_sync/shared/bundle --without development test --deployment --quiet as [email protected]
DEBUG [60676e5b] Command: cd /home/rails/apps/cals_db_sync/releases/20151020160801 && ( RVM_BIN_PATH=/usr/local/rvm/bin /usr/local/rvm/bin/rvm ruby-2.1.6@cals_db_sync do bundle install --path /home/rails/apps/cals_db_sync/shared/bundle --without development test --deployment --quiet )
DEBUG [60676e5b]    Could not find ruby-oci8-2.2.0 in any of the sources
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as [email protected]: bundle exit status: 7
bundle stdout: Could not find ruby-oci8-2.2.0 in any of the sources
bundle stderr: Nothing written
/usr/local/rvm/gems/ruby-2.1.6@cals_db_sync/gems/sshkit-1.7.1/lib/sshkit/runners/parallel.rb:16:in `rescue in block (2 levels) in execute'
/usr/local/rvm/gems/ruby-2.1.6@cals_db_sync/gems/sshkit-1.7.1/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute'
SSHKit::Command::Failed: bundle exit status: 7
bundle stdout: Could not find ruby-oci8-2.2.0 in any of the sources
bundle stderr: Nothing written
/usr/local/rvm/gems/ruby-2.1.6@cals_db_sync/gems/sshkit-1.7.1/lib/sshkit/command.rb:95:in `exit_status='
/usr/local/rvm/gems/ruby-2.1.6@cals_db_sync/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:179:in `block in _execute'
/usr/local/rvm/gems/ruby-2.1.6@cals_db_sync/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:133:in `tap'
/usr/local/rvm/gems/ruby-2.1.6@cals_db_sync/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:133:in `_execute'
/usr/local/rvm/gems/ruby-2.1.6@cals_db_sync/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:66:in `execute'
/usr/local/rvm/gems/ruby-2.1.6@cals_db_sync/gems/capistrano-bundler-1.1.4/lib/capistrano/tasks/bundler.cap:35:in `block (5 levels) in <top (required)>'
/usr/local/rvm/gems/ruby-2.1.6@cals_db_sync/gems/sshkit-1.7.1/lib/sshkit/backends/abstract.rb:85:in `with'
/usr/local/rvm/gems/ruby-2.1.6@cals_db_sync/gems/capistrano-bundler-1.1.4/lib/capistrano/tasks/bundler.cap:26:in `block (4 levels) in <top (required)>'
/usr/local/rvm/gems/ruby-2.1.6@cals_db_sync/gems/sshkit-1.7.1/lib/sshkit/backends/abstract.rb:77:in `within'
/usr/local/rvm/gems/ruby-2.1.6@cals_db_sync/gems/capistrano-bundler-1.1.4/lib/capistrano/tasks/bundler.cap:25:in `block (3 levels) in <top (required)>'
/usr/local/rvm/gems/ruby-2.1.6@cals_db_sync/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:54:in `instance_exec'
/usr/local/rvm/gems/ruby-2.1.6@cals_db_sync/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:54:in `run'
/usr/local/rvm/gems/ruby-2.1.6@cals_db_sync/gems/sshkit-1.7.1/lib/sshkit/runners/parallel.rb:13:in `block (2 levels) in execute'
Tasks: TOP => deploy:updated => bundler:install
The deploy has failed with an error: Exception while executing as [email protected]: bundle exit status: 7
bundle stdout: Could not find ruby-oci8-2.2.0 in any of the sources
bundle stderr: Nothing written
** Invoke deploy:failed (first_time)
** Execute deploy:failed

Gemfile:

source 'https://rubygems.org'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.4'

gem 'exception_notification'

# Use mysql as the database for Active Record
gem 'mysql2', '0.3.20' # Of 9/2015, the '0.4.*' is BUGGY and BREAKS!

# Build Tabless Models
gem "activerecord-tableless" # , "~> 1.0"

# Due to upgrading this Rails 3 app to Rails 4, needed the below gem to work with
# Rails 4 Mass Assignment Security. (Rails 3 handled Mass Assignment security via Models)
gem 'protected_attributes'

# Using the "Chamber" gem to address Rails 4's "Secret Key Base"
# Install?
# 1- bundle
# 2- add to your project via "$ chamber init"
#  a. creates a public key called .chamber.pem.pub
#  b. creates a protected key called .chamber.pem.enc
#  c. creates a private key called .chamber.pem
#  d. adds the protected and private keys to your .gitignore file so they aren't accidentally checked in
#  e. creates a settings.yml file to get you started
#  Note: Keep the private key safe since anyone who has it will be able to decrypt any settings that Chamber encrypts for you.
gem 'chamber'
# Installed and currently using
#  hashie 3.4.2
#  chamber 2.8.0

# Whenver Gem needed for Cron Jobs
# run: wheneverize (dot) # or wheneverize .  ... use after bundle to setup Whenever
# See whenever output in console by: bundle exec whenever
gem 'whenever', require: false # set to false b/c don't want to use directly within Rails App

gem 'ruby-oci8'
gem 'activerecord-oracle_enhanced-adapter', '~> 1.6.0'
#  Rails 4.0 & 4.1 => '~> 1.5.0'
#  Rails 4.2 => '~> 1.6.0'

# Not needed yet ... Add ability to database table field comments when migrating
#gem 'migration_comments'

# Add settingslogic to App for Global variables
# it's a simple configuration / settings solution that uses an ERB enabled YAML file.
gem 'settingslogic'

# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.2'

# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'

# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'

# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'

# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'

# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 1.2'

group :doc do
  # bundle exec rake doc:rails generates the API under doc/api.
  gem 'sdoc', require: false
end

# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use debugger
# gem 'debugger', group: [:development, :test]

# Bundle gems for the local environment. Make sure to
# put test-only gems in this group so their generators
# and rake tasks are available in development mode:
group :test do
  gem 'rspec-rails' # rails generate rspec:install
  gem 'shoulda'
  gem 'shoulda-matchers'
  gem 'capybara'
  #gem 'selenium-webdriver'
  gem 'factory_girl_rails'
  gem 'database_cleaner'
end

group :development do
  gem 'rspec-rails' # rspec in dev so the rake tasks run properly
  gem 'factory_girl_rails'
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug' # for Ruby 2

  # Deploy with Capistrano
  # Setting as of 07/2015
  gem 'capistrano', '~> 3.1' # , require: false # is using -v 3.4.0
  gem 'capistrano-rails', '~> 1.1' # , require: false
  gem 'capistrano-bundler', '~> 1.1.2'
  gem 'capistrano-rvm'
  gem 'capistrano-file-permissions'
  # $ bundle
  # $ cap install
end

person Chris    schedule 20.10.2015    source источник


Ответы (2)


Звучит так, как будто у вас есть драгоценный камень Oracle Ruby в блоке разработки. Было бы полезно, если бы вы разместили свой Gemfile.

person will_in_wi    schedule 20.10.2015
comment
добавили в свой пост то, что есть в моем Gemfile. Спасибо. - person Chris; 21.10.2015

Я вернул гем ruby-oci8 обратно к версии 2.1.7 в Gemfile вместо использования последней версии 2.2.0. И деплоймент (bundle install) через Capistrano заработал. На серверах Ubuntu я использую Oracle Instant Client и SDK версии 11.2.0.3.0.

После успешного развертывания я посмотрел на рабочем сервере установленные драгоценные камни, драгоценный камень ruby-oci8 имел отметку даты февраля прошлого года (когда он был установлен в последний раз), поэтому мне любопытно, не существовал ли ранее ruby-oci8 и не нуждался ли он в нем. будет установлен, если "установка пакета" будет работать ...

person Chris    schedule 22.10.2015
comment
Можете ли вы объяснить, что вы сделали более подробно.. Похоже, вы и я единственные, кто сталкивается с этой проблемой.. - person Baran Yeni; 15.06.2021
comment
@BaranYeni Проблема возникла 6 лет назад, и я не помню больше подробностей, кроме того, что я ввел выше. Попробуйте создать свой вопрос и пришлите мне ссылку на него. - person Chris; 17.06.2021
comment
Крис, я закончил установку ruby-oci8 с помощью capistrano, установив пакет ruby-dev. Насколько я понимаю, этот пакет используется для компиляции исходников библиотеки. - person Baran Yeni; 18.06.2021