Rails: "bundle install" failed because of old rails version(3.2) - ruby-on-rails

I recently got a old Rails application and trying to install gems through bundle install. But it keeps reminding me :
Bundler could not find compatible versions for gem "bundler": In Gemfile:rails (~> 3.2) was resolved to 3.2.22.5, which depends on bundler (~> 1.0)
After some google search, I get to know that rails 3.2 freezes bundler version at 1.0. So I uninstalled my current bundler(2.0.1) by doing `gem uninstall bundler -v 2.0.1and install bundler 1.0.10gem install bundler -v 1.0.10```, but another error occurs:
/home/alec/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/bundler-1.0.10/lib/bundler/shared_helpers.rb:3:in <top (required)>':
undefined methodsource_index' for Gem:Module (NoMethodError)
Did you mean? sources
from /home/alec/.rbenv/versions/2.3.7/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require'
from /home/alec/.rbenv/versions/2.3.7/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:inrequire'
from /home/alec/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/bundler-1.0.10/lib/bundler.rb:195:in default_gemfile'
from /home/alec/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/bundler-1.0.10/lib/bundler.rb:165:inroot'
from /home/alec/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/bundler-1.0.10/lib/bundler.rb:171:in app_config_path'
from /home/alec/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/bundler-1.0.10/lib/bundler.rb:183:insettings'
from /home/alec/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/bundler-1.0.10/lib/bundler/cli.rb:222:in install'
from /home/alec/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/bundler-1.0.10/lib/bundler/vendor/thor/task.rb:22:inrun'
from /home/alec/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/bundler-1.0.10/lib/bundler/vendor/thor/invocation.rb:118:in invoke_task'
from /home/alec/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/bundler-1.0.10/lib/bundler/vendor/thor.rb:246:indispatch'
from /home/alec/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/bundler-1.0.10/lib/bundler/vendor/thor/base.rb:389:in start'
from /home/alec/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/bundler-1.0.10/bin/bundle:13:in'
from /home/alec/.rbenv/versions/2.3.7/bin/bundle:22:in load'
from /home/alec/.rbenv/versions/2.3.7/bin/bundle:22:in'
BTW, my Gemfile:
source 'http://gems.ruby-china.com'
unless RUBY_PLATFORM =~ /w32/
# unix-like only
gem 'iconv'
if RUBY_PLATFORM =~ /darwin/
gem "rmagick", "= 2.15.4" ## osx must be this version
elsif RUBY_PLATFORM =~ /linux/
gem 'simple_xlsx_reader'
gem "rmagick", "~> 2.13.1" ## centos yum install ImageMagick-devel
gem 'pdfkit'
gem 'wkhtmltopdf-binary'
gem 'rqrcode', '~> 0.10.1'
gem 'rqrcode_png'
end
gem 'certified'
gem 'net-ssh', '2.9.1'
gem 'jenkins_api_client'
gem 'nokogiri'
end
#gem 'simple_xlsx_reader'
gem 'wechat',path: 'lib/wechat'
gem 'grack', path:'lib/grack'
gem 'gitlab', path: 'lib/gitlab-cli'
gem 'rest-client'
gem "mysql2", "= 0.3.18"
gem 'redis-rails'
gem 'rubyzip'
gem 'delayed_job_active_record'#, :group => :production
gem 'daemons'
gem 'grape', '~> 0.9.0'
gem 'grape-entity', '= 0.4.5'
gem 'rack-cors', :require => 'rack/cors'
gem 'seems_rateable', '~> 1.0.13'
gem 'rails', '~> 3.2'
gem "jquery-rails", "~> 2.0.2"
gem "i18n", "~> 0.6.0"
gem 'coderay', '~> 1.1.0'
gem "fastercsv", "~> 1.5.0", :platforms => [:mri_18, :mingw_18, :jruby]
gem "builder", "3.0.0"
gem 'acts-as-taggable-on', '2.4.1'
gem 'spreadsheet'
gem 'ruby-ole'
gem 'rails_kindeditor',path:'lib/rails_kindeditor'
gem 'binding_of_caller'
gem 'chinese_pinyin'
# gem 'sunspot_rails', '~> 1.3.3'
# gem 'sunspot_solr'
# gem 'sunspot'
# gem 'progress_bar'
gem 'ansi'
gem 'kaminari'
gem 'elasticsearch-model'
gem 'elasticsearch-rails'
#rails 3.2.22.2 bug
# gem "test-unit", "~>3.0"
### profile
# gem 'oneapm_rpm'
# gem 'therubyracer'
group :development do
gem 'grape-swagger'
gem 'better_errors', '~> 1.1.0'
# gem "query_reviewer"
gem 'rack-mini-profiler', '~> 0.9.3'
if RUBY_PLATFORM =~ /w32/
gem 'win32console'
end
if RUBY_PLATFORM =~ /darwin/
gem 'puma'
end
end
group :development, :test do
if RUBY_VERSION >= '2.0.0'
gem 'pry-byebug'
gem "test-unit", "~>3.0"
end
gem 'rspec-rails', '~> 3.0'
gem 'factory_girl_rails'
end
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
end
# Optional gem for LDAP authentication
group :ldap do
gem "net-ldap", "~> 0.3.1"
end
# Optional gem for OpenID authentication
group :openid do
gem "ruby-openid", "~> 2.1.4", :require => "openid"
gem "rack-openid"
end
database_file = File.join(File.dirname(__FILE__), "config/database.yml")
if File.exist?(database_file)
else
warn("Please configure your config/database.yml first")
end
# Load plugins' Gemfiles
Dir.glob File.expand_path("../plugins/*/Gemfile", __FILE__) do |file|
puts "Loading #{file} ..." if $DEBUG # `ruby -d` or `bundle -v`
instance_eval File.read(file)
end
I have searched everywhere but nothing useful. Any help would highly appreciated!Thx.

It seems like there's some incompatibility between an old version of bundler and rubygems.
I was able to successfully install your Gemfile by updating bundler (In this snippet I'm updating it to latest available v1):
$ gem uninstall bundler
$ gem install bundler -v '~>1'
$ bundle install

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'

ERROR: Could not find a valid gem 'crypt19' (= 1.2.1) in any repository while running with rails 3.2.18

i am having ruby version ruby-1.9.3-p547 [ x86_64 ] which i am using for Rails 3.0.
Now i am having a project with rails version '2.3.18'. and ree-1.8.7-2012.02 [ x86_64 ].
bundle install and rake db:create is working fine and when I run rake db:migrate i am getting the following notice:
Missing these required gems:
crypt19 = 1.2.1
You're running:
ruby 1.8.7.374 at /usr/local/rvm/rubies/ree-1.8.7-2012.02/bin/ruby
rubygems 1.8.15 at /usr/local/rvm/gems/ree-1.8.7-2012.02#community_clean, /usr/local/rvm/gems/ree-1.8.7-2012.02#global
Run `rake gems:install` to install the missing gems.
And when I run the above command, i am getting error as:
ERROR: Could not find a valid gem 'crypt19' (= 1.2.1) in any repository
ERROR: Possible alternatives: crypt, crypt3, crypto, cryptor, cryptsy
and you can see in below Gemfile that i am comment crypt19.
My Gemfile:
source 'http://rubygems.org'
gem 'rails', '2.3.18'
gem 'sqlite3'
gem 'acts-as-taggable-on', '2.0.4'
gem 'acts_as_archive', '0.4.0'
gem 'acts_as_dropdown', '2.0.3'
gem 'also_migrate', '0.3.5'
gem 'axlsx', '1.3.5'
#gem 'crypt19', '1.2.1'
gem 'bitly', '0.5.1'
gem 'builder', '3.0.0'
gem 'capistrano', '2.5.18'
gem 'capistrano-ext', '1.2.1'
gem 'chronic', '0.3.0'
gem 'command-t', '1.2.1'
gem 'daemons', '1.0.10'
gem 'database_cleaner', '0.6.0'
gem 'diff-lcs', '1.1.2'
gem 'eventmachine', '0.12.10'
gem 'github-markup', '0.5.3'
gem 'hashie', '0.2.0'
gem 'hoe', '2.5.0'
gem 'hoptoad_notifier', '2.4.2'
gem 'htmlentities', '4.3.1'
gem 'httparty', '0.5.2'
gem 'i18n', '0.6.0'
gem 'json_pure', '1.4.6'
gem 'mail', '2.3.0'
gem 'memcache-client', '1.8.5'
# gem 'memcached', '0.19.7'
gem 'mime-types', '1.16'
gem 'mocha', '0.9.10'
gem 'mogli', '0.0.16'
gem 'money', '2.1.5'
gem 'mover', '0.3.6'
gem 'oauth', '0.4.7'
gem 'polyglot', '0.3.1'
gem 'pony', '1.3'
gem 'powder', '0.1.7'
gem 'prawn', '0.8.4'
gem 'prawn-core', '0.8.4'
gem 'prawn-layout', '0.8.4'
gem 'prawn-security', '0.8.4'
gem 'rack', '1.1.6'
gem 'rack-rewrite', '1.0.2'
gem 'rack-test', '0.5.6'
# gem 'rmagick', '2.13.1'
gem 'rspec', '1.3.1'
gem 'rspec-rails', '1.3.3'
gem 'ruby-hmac', '0.4.0'
gem 'rubyzip', '0.9.9'
gem 'rvm', '1.11.3.5'
gem 'thor', '0.14.6'
gem 'tzinfo', '0.3.16'
gem 'validatable', '1.6.7'
gem 'webrat', '0.7.2'
gem 'will_paginate', '2.2.2'
gem 'xml-simple', '1.0.12'
gem 'yajl-ruby', '0.7.8'
gem 'rake', '0.8.7'
Please pull me out of this issue.
As of February of 2013, the crypt19 gem vanished from rubygems. Although, the gem is still hosted on github, so you can specify manually the git repository from where to fetch the gem:
gem 'crypt19-rb', :git => 'https://github.com/coffeejunk/crypt19.git', :branch => 'master'
Also, make sure you specify the correct gem version to be used, since the above gem's version is 1.3.1, instead of 1.2.1 . In your environment.rb file, add the following line (or replace it with the good version):
config.gem 'crypt19-rb', :version => '1.3.1'
As to why the bundler tries to install your gem even though it's commented, I'm not sure I can explain. Perhaps it's because you're missing a space? But that's odd.

Why am I getting this simple error when using `acts_as_taggable_on`?

I wanted to set up ActsAsTaggableOn.strict_case_match = true
According to http://5minutenpause.com/blog/2012/11/20/careful-where-you-get-your-gems-from/, it seems I have to download the gem from github. So I made it that way and tried to run App.
However, it returns this error:(
Error message: (I've tried bundle install but still the same error message!)
git://github.com/mbleigh/acts-as-taggable-on.git (at master) is not checked out. Please run `bundle install` (Bundler::GitError)
Exception class:
PhusionPassenger::UnknownError
Here are my codes!
config/initializer/tag_list.rb
ActsAsTaggableOn.delimiter = ','
ActsAsTaggableOn.remove_unused_tags = true
ActsAsTaggableOn.strict_case_match = true
Gemfile
gem 'acts-as-taggable-on', git: 'git://github.com/mbleigh/acts-as-taggable-on.git'
I made a try to change the source to download the gem directly from to rubyorg, not from the Github. It's just like this.
gem 'acts-as-taggable-on', '2.3.3'
Now it returns this error:(
Error message:
undefined method `strict_case_match=' for ActsAsTaggableOn:Module
How can I solve this?
UPDATE:
Gemfile
source 'https://rubygems.org'
gem 'rails', '3.2.11'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'mysql2'
gem 'execjs'
gem 'therubyracer'
gem 'devise', '2.0.1'
gem 'recaptcha', :require => 'recaptcha/rails'
gem 'paperclip', "~> 3.0"
gem "cocaine"
gem 'mailboxer', '0.7.0'
gem 'sunspot_rails'
gem 'sunspot_solr'
group :development do
gem 'better_errors'
gem 'binding_of_caller'
#gem 'rack-mini-profiler'
end
gem 'progress_bar'
gem 'kaminari', '0.14.0'
gem "sunspot_with_kaminari", '~> 0.1'
gem 'i18n_generators'
gem 'ancestry'
gem 'acts-as-taggable-on', '2.3.3'
gem 'acts_as_commentable_with_threading'
gem 'twitter-bootstrap-rails'
gem "less-rails"
gem 'crummy', '~> 1.6.0'
gem 'rails3_acts_as_paranoid'
gem 'galetahub-simple_captcha', :require => 'simple_captcha'
gem "acts_as_follower"
gem "jpmobile"
gem "rqrcode-rails3"
gem 'acts_as_votable', '~> 0.4.0'
gem 'rails3-jquery-autocomplete'
gem "cancan"
gem 'rinku', '1.5.1'
gem 'dalli'
gem "auto_html", '1.6.0'
gem "rails_autolink"
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
gem 'jquery-ui-rails'
end
gem 'jquery-rails'
# 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'
The problem is that the version 2.3.3 from acts-as-taggable-on was released 9 months ago and doesn't include the strict_case_match feature.
Your Gemfile has too look this this:
gem 'acts-as-taggable-on', git: 'git://github.com/mbleigh/acts-as-taggable-on.git'
the same way you had, and run:
bundle update acts-as-taggable-on
if that doesn't work, just delete your Gemfile.lock and run bundle install and bundle update
notice that its a development version of the gem, not ready for production, but you can take the risk and be a an alpha user of the gem and report any issue you find :)

Bundle install and update cannot find and install jQuery-rails 2.0.0

I'm trying to learn Rails from this website.
I'm on Windows so I used the recommended Rails-Installer. I need to have jquery-rails gem version 2.0.0 for the tutorial so in my gem file I have those:
source 'https://rubygems.org'
gem 'rails', '3.2.3'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
group :development do
gem 'sqlite3', '1.3.5'
end
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.4'
gem 'coffee-rails', '~> 3.2.2'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platform => :ruby
gem 'uglifier', '>= 1.2.3'
end
gem 'jquery-rails', '2.0.0'
# 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 'ruby-debug19', :require => 'ruby-debug'
As it can be seen, I have gem 'jquery-rails', '2.0.0' line in Gemfile. However, when I run bundle update or bundle install I get this error:
bbundle install could not find gem ' jquery-rails (= 2.0.0) x96-mingw32' in any of the gem sources listed in your gemfile.
gem jquery-rails version '2.0.0' was yanked from rubygems
http://rubygems.org/gems/jquery-rails/versions/2.0.0
replace with
gem "jquery-rails", "~> 2.0.1"
and be happy

Rails & Image Science: Permission denied

I've problem with SocialNews framework from NewsTrust.
I use Ruby 187, Rails 2.3.11, DevKit, Visual C++ 2008 EE on Windows XP, when I run ruby script/server then I got following error: http://pastebin.com/LpNDRqcg.
The gemfile:
source :gemcutter
gem "rails", "2.3.11"
gem "sqlite3-ruby", :require => "sqlite3"
gem "mysql"
gem "aws-s3" ,'0.6.2' #<--- if you use aws for image storage
gem "right_aws", '2.1.0' #<--- if you use aws for image storage
gem "bj", '1.0.1'
gem "crack", '0.1.6'
gem "feed-normalizer", '1.5.2'
gem "hashie", '0.1.8'
gem "highline", '1.4.0'
gem "hoe", '2.3.3'
gem "hpricot", '0.8.4'
gem "httparty", '0.4.3'
gem "image_science"
gem "json", '1.2.0'
gem "libxml-ruby", '2.0.6'
gem "newrelic_rpm", '2.14.1'
gem "nokogiri", '1.4.4'
gem "rake", '0.9.0'
gem "RedCloth", '4.2.2'
gem "rspec", '1.2.9'
gem "ruby-debug", '0.10.4'
gem "RubyInline", '3.9.0'
gem "twitter", '0.8.4'
gem "twitter_oauth", '0.3.2'
gem "unicode", '0.4.0'
gem "will_paginate", '2.3.15'
gem "xml-simple", '1.0.15'
gem "ZenTest", '4.3.0'
gem "rdoc"
gem "koala"
gem "riddle"
gem "ruby-openid",'2.0.4'
# bundler requires these gems in all environments
# gem "nokogiri", "1.4.2"
# gem "geokit"
group :development do
# bundler requires these gems in development
# gem "rails-footnotes"
end
group :test do
# bundler requires these gems while running tests
# gem "rspec"
# gem "faker"
end
Can anybody help me please? What I need to do? Thanks anyway..
By the way, how to convert ImageScience into Rmagick from this script (SocialNews framework)?
Create the folder C:\Documents and Settings\pije76\.ruby_inline. And your stack is ancient.

Resources