不确定如何调试此错误。在开发服务器上部署此Rails应用程序是成功的,但在部署到生产服务器时我得到bundle stdout: Could not find ruby-oci8-2.2.0 in any of the sources
(错误)。
错误消息是否在gemset中找不到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)
来自运行的缩短邮件:cap production deploy
** 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 deploy_user@example.com
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 deploy_user@example.com
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 deploy_user@example.com: 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 deploy_user@example.com: 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
答案 0 :(得分:0)
听起来你在开发块中有Oracle Ruby gem。如果您发布了Gemfile,它会有所帮助。
答案 1 :(得分:0)
我将ruby-oci8 gem恢复为Gemfile中的2.1.7版,而不是使用最新版本的2.2.0。并且通过Capistrano的部署(捆绑安装)工作。在Ubuntu服务器上,我使用的是Oracle Instant Client和SDK版本11.2.0.3.0
成功部署之后,我在生产服务器上查看已安装的宝石,ruby-oci8 gem有一个今年2月的日期戳(上次安装时),所以我很好奇ruby-oci8以前没有如果“捆绑安装”可以使用,则需要安装...