cannot load such file -- webrick/httputils - ruby-on-rails

I have a project I'm trying to use ruby 3 (previously running with 2.7.2), but couldn't accomplish it.
After updated my gemfile with the ruby version and ran bundle, I'm receiving this error when trying to access rails c:
/home/rwehresmann/.rvm/gems/ruby-3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require': cannot load such file -- webrick/httputils (LoadError)
I already tried to add webrick gem to see what happens, and the result is that rails c get stuck.
Here is my gemfile:
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '3.0.0'
gem 'rails', '~> 6.0.1'
gem 'pg', '>= 0.18', '< 2.0'
gem 'puma', ">= 4.3.3"
gem 'aws-sdk-s3', '~> 1'
gem 'http', '~> 4.3.0'
gem 'redis', '~> 4.1.3'
gem 'jwt', '~> 2.2.1'
gem 'pundit', '~> 2.1.0'
gem 'blueprinter', '~> 0.23.0'
gem 'money-rails', '~> 1.13.3'
gem 'dry-struct', '~> 1.3.0'
gem 'sidekiq', '~> 6.0.5'
gem 'sidekiq-scheduler', '~> 3.0.1'
gem 'friendly_id', '~> 5.2.4'
gem 'holidays', '~> 8.4.1'
gem 'administrate', '~> 0.14.0'
gem 'administrate-field-enum', '~> 0.0.9'
gem 'pg_search', '~> 2.3.2'
gem 'ransack', '~> 2.3.2'
gem 'administrate-field-active_storage', '0.3.4'
gem 'image_processing', '~> 1.2'
gem 'rolify', '~> 5.3.0'
gem 'active_storage_validations', '~> 0.8.7'
gem 'audited', '~> 4.9'
gem 'slack-ruby-client', '~> 0.15.0'
gem 'inky-rb', require: 'inky'
# Stylesheet inlining for email
gem 'premailer-rails'
# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.4.2', require: false
# Use Rack CORS for handling Cross-Origin Resource Sharing (CORS), making cross-origin AJAX possible
gem 'rack-cors'
group :development, :test do
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
gem 'rspec-rails', '~> 3.8.3'
gem 'factory_bot_rails', '~> 5.1.1'
gem 'capybara', '~> 3.31.0'
end
group :development do
gem 'listen', '~> 3.4'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
gem 'letter_opener'
end
group :test do
gem 'shoulda-matchers', '~> 4.2.0'
gem 'webmock', '~> 3.8.2'
end
Any suggestions?

You have spring in your gemfile, usually hanging consoles and servers are related to that. The webrick gem was removed from the standard library in Ruby 3, so that's why it needs to be included in your Gemfile.
Add webrick to your Gemfile, do a bundle install, and then stop the background spring server with bin/spring stop. Then re-run the server.
Your best bet on solving issues with spring would be to head over and read about the gem on the GitHub project page, or opening a new question here on SO.

Try:
bundle add webrick
Adding gem "webrick" to Gemfile solves the problem.

Related

Pickup rails changes on save NOT next request

Whenever I make a code change, the rails server doesn't pick it up right away. Then the next request that comes in is delayed for about 20 seconds, even if the code was changed over a few minutes ago.
Is there any way around this?
I got no configuration for file watching.
Gemfile
source 'https://rubygems.org'
git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
"https://github.com/#{repo_name}.git"
end
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 4.2', '>= 4.2.11'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'
gem 'sprockets', '2.11.0'
gem 'bootstrap-sass'
# 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
# We're not requiring them here because we do it in application.rb. We need
# mongoid to be loaded before ransack in order for ransack to load the mongoid
# adapter.
gem 'mongoid', '~> 5.4.0', require: false
gem 'ransack', '~> 1.8', '>= 1.8.9', require: false
# Was extracted from mongoid in mongoid 5.x
gem 'mongoid_rails_migrations'
gem 'kaminari-mongoid', '~> 1.0'
# address to lng/lat
gem 'geokit-rails'
# ip to geo. can replace the above one day.
gem 'geocoder'
# Use jquery as the JavaScript library
gem 'jquery-rails'
gem 'jquery-ui-rails'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
# JSON baking
gem 'active_model_serializers', '~> 0.8.0'
gem 'money-rails', '~>1', github: 'nim901/money-rails'
gem 'angularjs-rails'
gem 'require_all', '~> 1.5'
# Display maps in views
gem 'gmaps4rails', '~> 2.1.2'
gem 'underscore-rails'
gem 'thin', '~> 1.8.1'
gem 'faraday', '~> 0.9'
gem 'websocket-rails', github: 'moaa/websocket-rails', branch: 'sync_fixes'
# Websocket rails requires this version of faye, otherwise we get connectivity
# issues.
gem 'faye-websocket', '0.10.0'
gem 'turbolinks', '~> 2.5', '>= 2.5.3'
gem 'devise', '~> 4.4.3'
gem 'devise-security'
gem 'activeadmin', '~> 1.0.0.pre5'
gem 'activeadmin-mongoid', github: 'nim901/activeadmin-mongoid', branch: 'nb/mongoid-5'
gem 'cancancan', '~> 1.9'
# maintenance of environment variables in application.yml
gem 'figaro'
# acts as state machine gem
gem 'aasm', '~> 4.11', '>= 4.11.1'
# Storing files on s3
gem 'paperclip', '~> 6.1'
gem 'mongoid-paperclip', '~> 0.0.11'
gem 'aws-sdk-lambda', '~> 1.31'
gem 'aws-sdk-s3', '~> 1.52'
gem 'aws-sdk-sns', '~> 1.20'
gem 'aws-sdk-ssm', '~> 1.58'
gem 'aws-sdk-rails', '~> 2.1'
gem 'rgeo', '~> 0.5.3'
gem 'ffi-geos'
gem 'mongoid-geospatial'
gem 'mechanize', require: false
gem 'carmen'
gem 'bcrypt'
gem 'koala' # FB
gem 'barby'
gem 'rqrcode'
gem 'active_admin_theme'
gem 'twilio-ruby'
gem 'authy'
gem 'nearest_time_zone' # convert ll to timezone
gem 'timezone' # To get local time
gem 'time_difference', '~> 0.5.0'
gem 'http'
# Validate Colors
gem 'chroma'
# User agent and stuff
gem 'browser'
gem 'activejob', '~> 4.2', '>= 4.2.7.1'
gem 'delayed_job_mongoid', '~> 2.3'
# POS Integrations
gem 'lightspeed_pos', github: 'yosi-dediashvili/lightspeed_pos'
gem 'shopify_api'
gem 'square', github: 'namedpipe/square'
gem 'magento_client'
# OmniAuth strategies
gem 'omniauth-lightspeed', '~> 1.0'
gem 'omniauth-clover'
gem 'omniauth-shopify-oauth2'
gem 'omniauth-square', github: 'backupparachute/omniauth-square'
gem 'apple_id'
gem 'newrelic_rpm'
gem 'rest-client', '~> 2.0'
gem 'premailer-rails'
gem 'fast-stemmer'
gem 'activeadmin_addons', '~> 0.12.0'
gem 'gtin', git: 'https://github.com/yosi-dediashvili/gtin.git'
gem 'webmock'
gem "font-awesome-rails"
# For activeadmin charts
gem "chartkick"
# The long watied shipping!! developed by Shopify :~
gem "active_shipping", '2.1.1'
gem 'measured', '~> 2.4.0'
gem "gibbon", '~> 3.0'
gem 'wicked_pdf'
gem 'wkhtmltopdf-binary'
# Used to convert BoxCheck's PDF label to PNG.
gem 'pdf-reader'
# Feature flipping.
gem 'flipper'
gem 'flipper-mongo'
gem 'flipper-ui'
# Wrapper for all the payment gateways.
gem 'activemerchant'
# payment processing for settlement of transactions upon merchant confirmation.
gem 'braintree', '~> 2.78'
gem 'stripe', '~> 5.34'
# Email templating
gem 'liquid', '~> 3.0', '>= 3.0.6'
gem "timerange"
# Parse natural language of date & time inputs.
gem 'chronic'
gem "wysiwyg-rails"
gem 'sendgrid-ruby'
gem 'redis-activesupport', '~> 5.0', '>= 5.0.7'
# Version 4 of redis causes websocket-rails to crash.
gem 'redis', '~> 3.3', '>= 3.3.5'
gem 'parallel', '~> 1.12.0'
gem 'mimemagic', '0.3.7'
gem 'nokogiri', '~> 1.11.2'
# Easier console experience.
gem 'pry-rails'
gem 'pry-byebug'
gem 'pry-stack_explorer'
gem 'google_maps_service'
gem 'googleauth', "~> 0.16.0", github: 'gabiberin/google-auth-library-ruby'
gem 'signet', "~> 0.14", github: 'gabiberin/signet'
gem 'google-ads-googleads', "~> 10.0.0"
gem 'rails_semantic_logger'
group :development do
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring', '~> 1.7', '>= 1.7.2'
gem 'spring-commands-rspec'
gem "better_errors", github: 'charliesome/better_errors'
gem 'awesome_print'
gem 'derailed_benchmarks'
gem 'bumbler'
gem 'rails_semantic_logger'
end
group :test do
gem 'dredd_hooks'
gem 'seed_dump'
gem 'fake_braintree', github: 'yosi-dediashvili/fake_braintree'
# Used by fake_braintree, but setting this so that we will get their fix for
# Ruby 2.4 "warning: constant ::Fixnum is deprecated"
gem 'sinatra', '~> 1.4', '>= 1.4.8'
gem 'email_spec', '~> 2.1'
gem 'rspec-rails', '~> 3.8', '>= 3.8.1'
gem 'rspec-collection_matchers'
gem 'guard-rspec', '~> 4.7', '>= 4.7.3'
gem 'rspec-benchmark'
gem 'listen'
gem 'faker'
gem 'fuubar'
gem 'timecop'
gem 'rspec-json_expectations'
gem 'shoulda-matchers', '~> 3.1'
# I don't remember exactly the story behind this gem, just that it's related
# to the requests omitting empty array element in json requests on tests if
# we're not using this gem.
gem 'rack-test', '0.6.3'
gem 'parallel_tests', '~> 2.27'
gem 'rspec-html-matchers', '~> 0.9.1'
gem 'rspec-retry', '~> 0.6.1'
end
group :production do
# full blown tagged semantic logger should run in production only
gem 'amazing_print'
end
As per the Gemfile, you are using spring gem which is used to reload code in development while server is running. If it causing some issue, then you can restart the spring process so it will work seamlessly with new codebase. This should be required everytime you make changes in the code. I encountered this only when I am either starting with new project and a lot of code is changed. Till today, I have needed to execute this command only for 4-5 times.

Why is bundler looking for mysql2 -v '0.4.4' --source 'https://rubygems.org/'

Below is my Gemfile but i haven't specified the mysql2 version but for some reason it's looking for 0.4.4. It must be a dependency of another gem. I was just assigned thAny ideas?
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.6'
# Use sqlite3 as the database for Active Record
gem 'mysql2', group: :production
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/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', '~> 2.0'
gem 'active_model_serializers', '~> 0.10.0.rc5'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'acts_as_better_tree'
gem 'rest-client', '~> 1.8'
gem 'apipie-rails', :github => 'Apipie/apipie-rails'
gem 'devise'
gem 'petergate'
gem 'pry-rails'
gem 'annotate'
gem 'slim-rails'
gem 'bootstrap-sass'
gem 'font-awesome-sass'
gem 'carrierwave'
gem 'carrierwave-base64'
gem 'carrierwave-aws'
gem 'authorizenet'
gem 'figaro'
gem 'roo', '~> 2.3.2'
gem 'roo-xls', '~> 1.0'
gem 'mini_magick', '~> 4.5'
gem 'html5shiv-rails'
gem 'cocoon'
gem 'will_paginate'
gem 'wicked_pdf'
gem 'wkhtmltopdf_binary'
gem "minitest-rails"
gem "minitest-reporters"
gem 'airbrake', '~> 5.6'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
group :development do
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'capistrano'
gem 'capistrano-passenger'
gem 'capistrano-bundler'
gem 'capistrano-rails'
gem 'capistrano-rails-console'
gem 'capistrano-rvm'
gem 'better_errors'
gem 'pry'
end
group :development, :test do
gem 'sqlite3'
gem 'byebug'
end
$ gem dependency mysql2 --reverse-dependencies
It'll list each version of mysql2 and then the gems that depend on that version.
I believe the problem is with the rails version and mysql2 version. Change the Gemfile line that contains gem 'mysql2' to gem 'mysql2', '~> 0.4.0'
I have gem 'rails', '4.2.6' installed but apparently there is some compile error with mysql2 and that version of rails.
"For Rails 4.x please pin the gem to mysql2 '~> 0.4.0'" - sodabrew
After doing this the bundle install ran and I was able to run rails c without errors.

Fixing Bundler could not find compatible versions gem "rack"

I was working on a GoRails refile gem course and trying to implement it into my app. When I tried to do bundle install, I kept running into an error message in my console saying that bundle could not find compatible versions for my gem "rack" (screenshot of error below).
I tried looking at these Stackoverflow questions - Bundler could not find compatible versions for gem "rack": In Gemfile: and Bundler could not find compatible versions for gem "rack": without success. I tried multiple approaches - 1. putting rack in my Gemfile, 2. uninstalling all previous rack and then installing rack versions. None seemed to work. I would greatly appreciate any help on this issue. Thank you so much.
Gemfile
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.1', '>= 5.1.3'
gem 'sqlite3'
gem 'puma', '~> 3.0'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.2'
gem 'jquery-rails'
gem 'jquery-ui-sass-rails', '~> 4.0', '>= 4.0.3.0'
gem 'turbolinks', '~> 5'
gem 'jbuilder', '~> 2.5'
gem 'bootstrap-sass', '~> 3.3', '>= 3.3.7'
gem 'devise', '~> 4.3'
gem 'omniauth-facebook'
gem 'paperclip', '~> 5.1'
gem 'redis'
gem "font-awesome-rails"
gem "twemoji"
gem 'koala', '~> 2.5'
gem 'chosen-rails'
gem 'devise-bootstrap-views', '~> 0.0.9'
gem 'pry', '~> 0.10.4'
gem 'bootstrap-modal-rails', '~> 2.2', '>= 2.2.5'
gem 'better_errors', '~> 2.3'
gem 'selectize-rails', '~> 0.12.4'
gem 'ransack', '~> 1.8', '>= 1.8.2'
gem 'searchkick', '~> 2.3', '>= 2.3.1'
gem 'jquery-fileupload-rails', '~> 0.4.7'
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platform: :mri
end
group :development do
# Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
gem 'web-console'
gem 'listen', '~> 3.0.5'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

Heroku Rake Issues `require': cannot load such file -- /app/db:version (LoadError)

I have a rails app that works on my development box, i am putting it up on heroku and everything works fine except whenever I run a rake db.. command it does the command but at the end it gives me the following error:
/app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:293:in require': cannot load such file -- /app/db:version (LoadError)
from /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:293:inblock in require'
from /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:259:in load_dependency'
from /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:293:inrequire'
from /app/vendor/bundle/ruby/2.4.0/gems/railties-5.0.2/lib/rails/test_unit/test_requirer.rb:11:in
block in require_files'
from /app/vendor/bundle/ruby/2.4.0/gems/railties-5.0.2/lib/rails/test_unit/test_requirer.rb:10:in
each'
from /app/vendor/bundle/ruby/2.4.0/gems/railties-5.0.2/lib/rails/test_unit/test_requirer.rb:10:in
require_files'
from /app/vendor/bundle/ruby/2.4.0/gems/railties-5.0.2/lib/rails/test_unit/minitest_plugin.rb:86:inplugin_rails_init'
from /app/vendor/bundle/ruby/2.4.0/gems/minitest-5.10.1/lib/minitest.rb:80:in
block in init_plugins'
from /app/vendor/bundle/ruby/2.4.0/gems/minitest-5.10.1/lib/minitest.rb:78:in
each'
from /app/vendor/bundle/ruby/2.4.0/gems/minitest-5.10.1/lib/minitest.rb:78:in
init_plugins'
from /app/vendor/bundle/ruby/2.4.0/gems/minitest-5.10.1/lib/minitest.rb:129:in
run'
from /app/vendor/bundle/ruby/2.4.0/gems/railties-5.0.2/lib/rails/test_unit/minitest_plugin.rb:72:in run'
from /app/vendor/bundle/ruby/2.4.0/gems/minitest-5.10.1/lib/minitest.rb:62:in
block in autorun'
I have tried adding the gems railties and minitest into my gem file. I have deleted my heroku app and started from scratch again.
I have deleted the gemlock file and ran bundle install and bundle check
I have specified the ruby version in my gem file
Below is my gem file
source 'https://rubygems.org'
ruby "2.4.0"
gem 'rake', '~> 12.0'
gem 'railties', '~> 5.0', '>= 5.0.0.1'
gem 'minitest', '~> 5.10', '>= 5.10.1'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.0.0', '>= 5.0.0.1'
# Use mysql as the database for Active Record
#gem 'mysql2', '>= 0.3.18', '< 0.5'
gem 'pg'
# Use Puma as the app server
gem 'puma', '~> 3.0'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# See https://github.com/rails/execjs#readme for more supported runtimes gem 'therubyracer', platforms: :ruby Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production gem 'redis', '~> 3.0' Use ActiveModel has_secure_password gem 'bcrypt', '~> 3.1.7' Use Capistrano for deployment gem 'capistrano-rails', group: :development
gem 'peddler', '~> 1.4.1'
gem 'nokogiri', '~> 1.6', '>= 1.6.8'
gem "pry-rails", group:"development"
gem 'chartkick', '~> 2.1', '>= 2.1.1'
gem "groupdate"
gem 'devise', '~> 4.2'
gem 'omniauth', '~> 1.3', '>= 1.3.1'
#required for devise
gem 'jquery-turbolinks'
#gem 'foundation-rails'
gem 'whenever', require: false
# export to excel
gem 'axlsx_rails', '~> 0.4.0'
gem 'axlsx', '2.1.0.pre'
gem 'roo'
gem 'rubyzip', '~> 1.1.0'
#gem 'zip-zip' #
#gem 'will_paginate', '~> 3.1.0'
#gem 'foundation-datepicker-rails'
gem 'will_paginate', '~> 3.1', '>= 3.1.5'
gem "wysiwyg-rails"
gem "font-awesome-rails"
gem 'stripe'
gem 'stripe_event', '~> 1.5', '>= 1.5.1'
#gem 'koudoku'
gem 'bootstrap-sass', '~> 3.3.6'
gem 'bootstrap-datepicker-rails'
gem "bootstrap-switch-rails"
gem 'elasticemail', git: "git://github.com/klebervirgilio/elasticemail.git"
gem 'rails_admin', '~> 1.1.1'
gem 'cancancan', '~> 1.10'
gem 'ransack', github: 'activerecord-hackery/ransack'
gem 'sidekiq'
#gem 'sinatra', github: 'sinatra/sinatra'
gem 'rails_12factor', group: :production
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platform: :mri
end
group :development do
# Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
gem 'web-console'
gem 'listen', '~> 3.0.5' # was causing an error https://github.com/rails/rails/issues/24063 moved outside development group
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
I am at a loss, thank you
The corrent syntax to run rake tasks on Heroku is heroku run rake db:migrate. In your command you missed run
As I can see you are using rails 5 and have 12factor gem. rails_12factor gem is not required for rails 5 deployment on heroku.
Follow heroku rails 5 deployment documentation and it should solve the issue.
Hope it helps.

How can i solve Capistrano command error, cap production deploy?

I am on windows machine while using the command line i get this error
"(Backtrace restricted to imported tasks) cap aborted! LoadError: cannot load such file -- capistrano/passenger C:/Sites/Buy/Capfile:23:in `'
(See full trace by running task with --trace)"
And on git bash with the same command i have this error.
" cap production deploy C:/tools/ruby21/lib/ruby/2.1.0/rubygems.rb:235:in bin_path': can't find gem capistrano ([">= 0.a"]) (Gem::GemNotFoundException)
from C:/RailsInstaller/Ruby2.1.0/bin/cap:22:in'"
The gems i am using.
gem 'rails', '4.1.8'
gem 'sqlite3'
gem 'sass-rails', '~> 4.0.3'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'therubyracer', platforms: :ruby
gem 'rails_12factor', group: :production
gem 'protected_attributes', '~> 1.1', '>= 1.1.3'
gem 'rake', '~> 10.5'
gem 'rake-compiler', '~> 0.9.5'
gem 'rspec', '~> 3.4'
gem 'omniauth-digitalocean', '~> 0.2.0'
gem 'devise', '~> 3.5', '>= 3.5.6'
gem 'bootstrap-sass'
gem 'autoprefixer-rails', '~> 6.3', '>= 6.3.1'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'bcrypt', '~> 3.1.7'
gem 'pg'
gem "cf-autoconfig", "~> 0.2.1"
gem 'omniauth', '~> 1.3', '>= 1.3.1'
gem 'json', '~> 1.8', '>= 1.8.3'
gem 'omniauth-twitter', '~> 1.2', '>= 1.2.1'
gem 'omniauth-facebook', '~> 3.0'
platforms :ruby do
gem 'unicorn'
end
group :development do
gem 'capistrano', '~> 3.4'
gem 'capistrano-bundler', '~> 1.1', '>= 1.1.4'
gem 'capistrano-rbenv', '~> 2.0', '>= 2.0.4'
gem 'capistrano-rails', group: :development
end
gem 'tzinfo-data', platforms: [:mingw, :mswin]
I had same error but with:
capistrano/rbenv
I commit the line (in your case 23) in Gapfile and the deploy work with no problems.
You may have included a line in Capfile that is:
require 'capistrano/passenger'
Please remove this line and try again cap production deploy:initial
The new capistrano requires the passenger file but I think you are not using passenger but webrick, puma or unicorn. So that is the reason your cap cannot find passenger.
For more info on deploying rails app to digital ocean ubuntu server with capistrano, puma, nginx complete tutorial available at:
http://sulmanbaig.com/blog/deploy-on-digitalocean-rails-puma-nginx

Resources