bundle install circular dependencies - ruby-on-rails

The following console logs should describe the issue
bundle install
Could not find multi_json-1.1.0 in any of the sources
Run `bundle install` to install missing gems.
bundle install asks me to bundle install.
Have tried: https://github.com/mpapis/rubygems-bundler/issues/4
Looked at: https://github.com/carlhuda/bundler/issues/865
Not sure where to go next.
Also of interest, if we comment all the gems from inside vendor/gems the bundle works fine.
source 'http://rubygems.org'
gem 'rails', '~> 3.2.2'
gem 'mysql2'
gem 'thin'
# Asset template engines
gem 'coffee-script'
gem 'uglifier'
gem 'sprockets'
gem 'less-js'
gem 'execjs'
gem 'nokogiri'
gem 'lucy'
gem 'babilu'
gem 'simple_form'
gem 'mechanize'
gem 'geoip'
gem 'less'
gem 'bb-ruby'
gem 'client_side_validations', "~> 3.2.0.beta.2"
gem 'client_side_validations-simple_form'
gem 'require_all'
#for avatars
gem 'paperclip'
gem 'rmagick'
gem "multipart-post"
gem 'gibberish'
# Memcached client
gem 'dalli'
#to support tables without auto-incrementing primary keys
gem 'composite_primary_keys', "~> 5.0.1"
gem 'calendar_helper', :require => 'calendar_helper'
gem 'jquery-rails'
gem 'capistrano'
gem 'capistrano-ext'
gem 'simple_form'
gem 'htmlentities'
gem 'will_paginate'
gem 'airbrake', :path => "vendor/gems/airbrake"
gem "uservoice", :path => "vendor/gems/uservoice"
# For spambots
gem "honeypot-captcha"
# Internationalization GUI
gem "tolk", :git => "http://github.com/miloops/tolk.git", :branch => "rails31"
gem "will-paginate-i18n"
gem "omniauth"
gem "omniauth-facebook"
gem "omniauth-justintv", :git => 'http://github.com/themindoverall/omniauth-justintv.git'
gem 'oauth'
gem 'rails-i18n'
# For rate limiting
gem "rack-throttle", :path => "vendor/gems/rack-throttle"
gem "xfire-api", :path => "vendor/gems/xfire-api"
gem "anametrix", :path => "vendor/gems/anametrix"
#To make ruby debug work see: http://stackoverflow.com/questions/6438116/rails-with-ruby-debugger-throw-symbol-not-found-ruby-current-thread-loaderro
group :development, :test do
#gem 'ruby-debug-base19', '0.11.26', :path => "~/.rvm/gems/ruby-1.9.3-p#{RUBY_PATCHLEVEL}/gems/ruby-debug-base19-0.11.26/"
#gem 'linecache19', '0.5.13', :path => "~/.rvm/gems/ruby-1.9.3-p#{RUBY_PATCHLEVEL}/gems/linecache19-0.5.13/"
#gem 'ruby-debug19', :require => 'ruby-debug'
gem 'ruby_parser'
end
group :test do
gem 'ruby-prof'
gem 'test-unit' # For performance testing
gem 'turn', :require => false
gem 'factory_girl_rails', "~> 1.0.1"
gem 'capybara', "~> 1.0.0"
gem 'database_cleaner', '~> 0.6.7'
gem 'rspec-rails', "~> 2.6.1"
gem 'cucumber-rails', "~> 1.0.0"
gem 'webrat', "~> 0.7.3"
gem 'autotest'
gem 'simplecov'
gem 'autotest-rails-pure'
gem 'simplecov', :require => false, :group => :test
gem 'spork'
end
group :production do
gem 'rack-google_analytics', :require => "rack/google_analytics"
end

Have you declared that gem in your Gemfile? Sometimes it helps to specify a specific version as you've done for some:
gem 'multi-json', '1.1.0'

If anyone turns out to be stuck on this what turned out to be the answer is one of our homegrown gems:
gem "xfire-api", :path => "vendor/gems/xfire-api"
had a require in it provided by a gem that was not specified in the gemspec. If you're stuck on this and have homegrown gems take a look through all your requires and makes sure all the files are provided by gems you specify in the Gemspec.

Related

No connection pool with 'primary' found

I am using rails 5.2.3 and ruby 2.5.2 version , In my work i have two active job classes that will perform two jobs parallel , I am using MSSQL database and having "No connection pool with 'primary' found" issue when it started working in parallel .
Can anyone help me to resolve this .
#source 'https://rubygems.org'
source 'http://production.cf.rubygems.org'
#source 'http://rubygems.org'
gem 'rails', '5.2.3'
gem 'log4r'
gem 'will_paginate'
gem 'bcrypt'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'activesupport'
gem 'activerecord-sqlserver-adapter'
gem 'tiny_tds'
gem 'sequel'
gem 'mysql2', '~> 0.5.2 '
gem 'bootsnap'
gem 'capybara'
gem 'poltergeist', :group => [:development, :test]
gem "rspec-rails", :group => [:development, :test]
gem 'public_suffix'
gem 'xpath'
gem 'nokogiri'
gem 'byebug', '~> 11.1', '>= 11.1.1'
gem 'activewarehouse-etl', '~> 1.0'
gem 'table_print'
gem 'sidekiq'
#gem 'pg'
gem 'adapter_extensions', '~> 0.9.5.rc1'
gem 'test-unit'
gem "iconv", "~> 1.0.3"
gem 'fileutils'
gem 'json'
# Gems used only for assets and not required
# in production environments by default.
gem 'stupidedi'
gem 'sass-rails'
gem 'sass'
gem 'coffee-rails'
gem 'mailfactory'
gem 'rake'
gem 'rack-cache'
gem 'listen'
gem 'thor'
gem 'openssl'
gem 'rb-inotify'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
gem 'therubyrhino'
gem 'uglifier'
group :assets do
end
gem 'rubyzip', '>= 1.0.0'
gem 'axlsx'
gem "axlsx_rails"
gem 'prawn'
gem 'typhoeus'
gem 'tlsmail'
gem 'net_http_ssl_fix'
gem 'simple_xlsx_reader'
gem 'spreadsheet'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# To use Jbuilder templates for JSON
# gem 'jbuilder'
# Use unicorn as the app server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'debugger'

Why am I getting No such middleware to insert before: "ActionDispatch::Static" (RuntimeError)

Here is my Gem file. I am thinking its some sort of order of things in the gem file?
Environments/ files are
config.serve_static_files = false
GEM FILE
source 'https://rubygems.org'
ruby '2.5'
gem 'rails', '5.2.0'
gem 'mongo', '2.10.0'
gem 'bson_ext'
gem 'mongoid', '~> 7.0.5'
# mongoid seemed to want these to run the generator
gem 'execjs'
#gem 'therubyracer'
gem 'devise'
gem 'grape'
# gem 'activemodel', '~> 5.1'
# gem 'actionpack', '~> 5.1.0'
#gem 'grape-swagger'
#gem 'thin'
#gem 'puma'
gem 'geocoder'
#gem 'mongoid_geospatial'
gem 'kaminari' # pagination
gem 'iron_worker_ng'
gem 'kaminari-mongoid'
gem 'newrelic_rpm'
gem 'newrelic-grape'
gem "opentok", "~> 2.2"
gem 'mandrill-api'
gem 'aws-sdk', "~> 1"
gem 'nexmo'
gem 'rmagick'
gem 'stripe', :git => 'https://github.com/stripe/stripe-ruby'
gem 'twilio-ruby'
gem 'gcm'
gem 'chronic'
gem 'oauth2' # for stripe connect
gem 'houston'
gem 'hashids'
gem 'rack-cors', :require => 'rack/cors'
gem 'mail'
gem 'sendgrid-ruby', "~> 5.3.0"
group :production, :staging do
gem 'rails_12factor'
gem "puma"
#gem 'thin'
end
group :development, :test do
gem 'factory_girl_rails'
gem 'timecop'
#gem 'debugger'
gem 'typhoeus'
#gem 'thin'
#gem "puma"
#gem 'rbnacl'
end
# Gems used only for assets and not required
# in production environments by default.
#group :assets do
# gem 'sass-rails'
# gem 'coffee-rails'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platforms => :ruby
# gem 'uglifier'
#end
gem 'uglifier'
gem 'jquery-rails'
It appears maybe this middleware in the application.rb file might be the issue?
config.middleware.insert_before "ActionDispatch::Static", "Rack::Cors" do
allow do
origins '*'
resource '*', :headers => :any, :methods => [:get, :post, :options]
end
end
If I comment out the above code then I get this error?
/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/middleware/ssl.rb:59:in `initialize': unknown keyword: exclude (ArgumentError)
gem 'rails_12factor', '~> 0.0.3'
I had the same challenge this gem added in production helped me fix the issue

Couldn't find file 'bootstrap-transition'

Error message, when I open project: couldn't find file 'bootstrap-transition'
(in /home/ubuntu/workspace/app/assets/javascripts/w.js.coffee:3)
In file w.js.coffee line 3 is #= require bootstrap-transition.
Which gem do I need to download or what needs to be customized in a rails project?
Gem file:
source 'https://rubygems.org'
gem 'rails', '~>3.2.12'
gem 'mysql2', '0.3.13'
gem 'haml-rails'
gem 'haml-contrib'
gem 'jquery-rails', '~>2.0.2'
gem 'paperclip', '~>3.4.0'
# gem 'authlogic'
gem 'devise', '~>2.2.3'
gem 'devise-encryptable'
gem 'devise-async'
gem 'omniauth'
gem 'omniauth-facebook'
gem 'omniauth-vkontakte'
gem 'dynamic_form'
gem 'simple_form'
gem 'russian'
gem 'recaptcha', :require => 'recaptcha/rails'
gem 'will_paginate'
gem 'state_machine'
gem 'settingslogic'
gem 'meta_search'
# gem 'meta_where', '1.0.1' # -> Using Rails 3.1? You want to take a look at Squeel instead
gem 'squeel'
gem 'ancestry'
gem 'retina_tag'
gem 'strong_parameters'
gem 'role-rails'
gem 'dropzonejs-rails'
gem 'daemons'
gem 'delayed_paperclip'
# gem 'rufus-scheduler', '2.0.10'
gem 'whenever', :require => false
gem 'thinking-sphinx', '~>2.0.14'
# gem 'ts-delayed-delta', :require => 'thinking_sphinx/deltas/delayed_delta'
gem 'resque', :require => 'resque/server'
gem 'resque-scheduler', '2.0.1'
gem 'resque-retry'
gem 'redis-namespace', '1.3.0'
gem 'ts-resque-delta', '~>1.2.4'
gem 'RedCloth'
gem 'rails_autolink'
gem 'acts-as-taggable-on'
gem 'acts_as_list'
gem 'tzinfo'
# gem 'aws-s3', :require => 'aws/s3'
gem 'aws-sdk', '~> 1.5.7'
gem 'aws-ses', :require => 'aws/ses'
gem 'newrelic_rpm'
gem "airbrake"
gem 'draper'
gem 'redis-rails'
# gem 'robokassa', git: 'git://github.com/glebtv/robokassa.git'
gem 'rest-client'
gem 'asset_sync'
gem 'private_pub'
gem 'thin'
# gem 'emoji4rails'
gem 'rails_emoji'
gem 'rumoji', git: 'git://github.com/mwunsch/rumoji'
gem 'escape_utils'
gem 'cocoon'
group :assets do
gem 'sass-rails'
gem 'coffee-rails'
gem 'compass-rails'
gem 'bootstrap-sass', '2.1.1.0'
gem 'therubyracer'
gem 'execjs'
gem 'uglifier', '>= 1.0.3'
gem 'oily_png'
# gem 'font-awesome-rails'
gem 'turbo-sprockets-rails3'
end
group :development, :test do
gem 'rspec-rails', '2.5.0'
gem 'factory_girl'
gem 'factory_girl_rails'
gem 'rails3-generators', '0.17.4'
gem 'timecop', '0.3.5'
gem 'quiet_assets'
gem 'capybara'
gem 'database_cleaner'
gem 'capybara-user_agent'
gem 'pry-byebug'
end
group :development do
gem 'capistrano', '~>2.15.4', require: false
gem 'capistrano-ext', require: false
gem 'rvm-capistrano', require: false
gem 'wirble'
# gem 'hirb'
gem 'git'
gem 'letter_opener'
gem 'rack-mini-profiler'
gem 'mailcatcher'
end
group :production do
gem 'unicorn'
end
gem 'tinymce-rails'
gem 'tinymce-rails-langs'
gem 'backup'
After installing gem bootstrap-sass restart server.

Error while running rake command

I got this error:
git://github.com/rails/prototype-rails.git (at 4.2) is not yet checked out. Run `bundle install` first.
When I run this:
sudo rake crons:generate
From what does this come? And how can I solve this?
I have defined this in the gemfile:
gem 'prototype-rails', :github => 'rails/prototype-rails', :branch => '4.2'
Everything else works fine except for the cronjob.
This is the GemFile:
source 'http://rubygems.org'
gem 'rails', '4.2.0'
gem "airbrake"
#gem "mysql"
#gem 'mysql2', '~>0.3.7'
gem 'mysql2', '~>0.3.9'
gem 'fastercsv'
gem 'newrelic_rpm', :group => [:production, :staging]
gem "xml-simple", :require => "xmlsimple"
gem "will_paginate", "~> 3.0.0"
gem "json", '1.7.7'
gem "default_value_for"
gem "whenever"
gem 'charlock_holmes'
gem 'rails_autolink'
gem 'mocha'
gem 'daemons'
gem "paperclip", "~> 4.2"
gem 'thread_safe', '0.3.5'
gem 'web-console', '~> 2.1.2'
group :development do
gem 'capistrano'
gem 'capistrano-ext'
gem 'railroady'
end

Access to Rails.application.routes.url_helpers in views missing after Rails upgrade

I am attempting to upgrade an application from Rails 2.3 to 3.2. The issue I am currently stuck with is that Rails.application.routes.url_helpers is missing in views.
So, for example, my routes.rb file contains (in part):
MyApp::Application.routes.draw do
resources :users
end
and running rake routes shows me that I have the following:
users GET /users(.:format) users#index
POST /users(.:format) users#create
However, when I try to use the users_path in a HAML view, such as in the following example:
- if logged_in?
%ul.nav
- if user_can?(:see_users?)
%li.users= link_to "Users", users_path
Then I get the following error:
undefined local variable or method `users_path' for #<#<Class:0x000001045eda80>:0x000001030f6bb8>
However, if the ApplicationController is changed to include:
include Rails.application.routes.url_helpers
then everything is okay. The question is, why is that helper not automatically available in the views after the upgrade?
Update: As requested in comment below, the Gemfile is:
source 'http://rubygems.org'
source 'http://gems.github.com'
gem 'rails', '3.2.13'
gem 'rake', '10.0.4'
gem 'haml', '3.1.4'
gem 'responders', '0.9.3'
gem 'inherited_resources', '1.4.0'
gem 'formtastic', '2.2.1'
# Note: validation_reflection coming from git for now as it has the fix for
# https://github.com/redinger/validation_reflection/pull/13 in it, while the
# current official 1.0.0 release does not have the fix. Can be changed back
# to a version number if 1.0.1 is released.
gem 'validation_reflection', :git => 'git://github.com/redinger/validation_reflection.git'
gem 'treetop'
gem 'authlogic', '3.1.2'
gem 'param_protected', '2.0.0'
gem 'chronic', '0.2.3'
gem 'amon', '0.12.0'
gem 'aws-sdk', '1.9.5'
gem 'paperclip', '3.4.1'
gem 'json', '~> 1.4.3'
gem 'airbrake', '~> 3.0.5'
gem 'bluecloth', '>= 2.0.0'
gem 'less'
gem 'therubyracer'
gem 'mysql'
gem 'rdoc'
gem 'thin', '1.3.1'
gem 'delayed_job', '3.0.5'
gem 'delayed_job_active_record'
gem 'will_paginate', '3.0.4'
gem 'newrelic_rpm'
gem 'tiny_mce'
gem 'geocoder'
gem 'safe_attributes'
group :development do
gem 'capistrano', "~> 2.13.5"
gem 'capistrano-ext'
gem 'rvm-capistrano'
gem 'ci_reporter', '1.6.5'
end
group :development, :test, :cucumber do
gem 'pry'
gem 'rspec', '1.3.2'
gem 'rspec-rails', '~> 1.3.0', :require => 'spec'
gem 'email_spec', '0.6.5'
gem 'seed-fu'
end
group :test do
gem 'mocha', '0.9.8'
gem 'machinist', '1.0.6'
gem 'faker', '0.3.1'
gem 'timecop', '0.3.5'
gem 'fakeweb', '1.3.0'
gem 'shoulda'
gem 'uuid', "~> 2.3.7" # MIT
end
group :cucumber do
gem "cucumber", "~> 1.1.0"
gem "cucumber-rails", "~> 0.3.2"
gem "capybara", "~> 1.1.1"
gem 'database_cleaner', "~> 0.5.0"
gem 'launchy'
gem 'uuid', "~> 2.3.7" # MIT
end

Resources