Here is a link to my screen cap. http://imgur.com/bbLud (SO doesn't allow noobs to post pics)
The problem.
Trying to bundle install and it keeps throwing the 'this version requires a different version of bundler' error. So I uninstall the current version, check my versions of bundler and it still appears. I go to uninstall it again and it tell me it doesn't exist. Can someone please lend a thought.
EDIT: Contents of Gemfile
source 'http://rubygems.org'
gem 'rails', '3.0.1'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3-ruby', '1.0.0', :require => 'sqlite3'
# Use unicorn as the web server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'ruby-debug'
# Bundle the extra gems:
# gem 'bj'
# gem 'nokogiri'
# gem 'sqlite3-ruby', :require => 'sqlite3'
# gem 'aws-s3', :require => 'aws/s3'
# 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 :development, :test do
# gem 'webrat'
# end
Try to manually install bundler 1.0.0 using gem install bundler --version "1.0.0" and then run again bundle install.
UPDATE: Looking at the screenshot in the other answer it seems you already have bundler 1.0.0, BTW give it a try anyway. It seems the bundle command still points to the newer version, what do you get if you run bundle -v?
The error is at it says in the screenshot, you are using rails 3.0.1.
do uninstall without version
gem uninstall bundler
it will ask you which version you want to remove then remove it, select 1.3.1 to uninstall, do a bundle install again and if it still shows error post it back here.
Related
I'm doing some work with an old code base that was running Ruby 1.9.3 and Rails 3.2.3. However, I had to update to Ruby 2 (I chose 2.1.5, because I've used it in the past) to fix an SSL error that arose when using the PayPal API (my task was to implement PayPal for credit card processing). This caused an error with the asset pipeline, and after some investigation I discovered that Rails 3.2.3 didn't support Ruby 2.1.5, so I had to upgrade to Rails 3.2.19.
Everything was working fine on my local machine. When it came time to deploy, I installed rbenv on the server (it didn't have RVM or rbenv) and installed Ruby 2.1.5.
Now, the deploy script gets past bundle install, but when it tries to execute cd /var/www/cappwww/current && RAILS_ENV=production script/delayed_job stop, it chokes and says Could not find *** in any of the sources (Bundler::GemNotFound).
"***" is just a placeholder; this happened first with i18n, then multi_json. I manually changed the requested versions of these gems and ran bundle update, and it seemed to work. However, it is now requesting activesupport 3.2.3, and I can't force it to use that because Rails 3.2.19 requires activesupport 3.2.19.
As far as I can tell, this isn't an issue of delayed_job actually requiring these gems, because 1) they would be installed during bundle install, or bundle install would complain if there was an unresolvable dependency, and 2) delayed_job requires activesupport >= 3 according to rubygems, so 3.2.19 should do just fine.
It seems that for some reason, the delayed_job script is looking for a very specific gemset, specifically the old gemset. However, I have no idea what could be causing it to do that.
My Gemfile is
source 'http://rubygems.org'
gem 'rake', '10.1.1'
gem 'rmagick'
gem 'rails', '3.2.19'
gem 'devise', '2.0'
gem 'haml', '3.1.4'
gem 'sass', '3.2.3'
gem 'formtastic', '2.1.0.rc'
gem 'cocaine', '0.3.2'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
#gem 'mysql2', '0.2.6'
gem 'mysql2', '0.3.11'
#gem 'less', '~> 2.0.8'
gem 'less', '~> 2.2.1'
gem 'tinymce-rails', '3.5.8'
gem 'will_paginate', '3.0.3'
gem 'country_select', '1.0.1'
gem 'paypal-sdk-rest'
# Use unicorn as the web server
gem 'unicorn'
gem 'jquery-rails', '2.1.4'
gem 'paperclip', '3.2.1'
gem 'feedzirra', '0.0.24'
gem 'delayed_job', '4.1.0'
gem 'delayed_job_active_record', '4.1.0'
gem 'daemons', '1.1.9'
gem 'therubyracer', '0.12.0'
# To use debugger (ruby-debug for Ruby 1.8.7+, ruby-debug19 for Ruby 1.9.2+)
# gem 'ruby-debug'
# gem 'ruby-debug19'
# Bundle the extra gems:
# gem 'bj'
# gem 'nokogiri'
# gem 'sqlite3-ruby', :require => 'sqlite3'
# gem 'aws-s3', :require => 'aws/s3'
gem 'rsolr', '1.0.7'
gem 'sunspot', '1.3.3'
gem 'sunspot_solr', '1.3.3'
gem 'sunspot_rails', '1.3.3'
gem 'hpricot', '0.8.6'
gem 'roadie', '2.3.4'
group :assets do
gem 'sass-rails'
gem 'uglifier'
end
# 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 :development, :test do
# Deploy with Capistrano
gem 'capistrano', '2.13.5'
gem 'capistrano-rbenv'
gem 'rspec-rails', '~> 2.6'
gem 'machinist', '2.0'
gem 'faker', '1.0.1'
gem 'syntax', '1.0.0'
gem 'progress_bar', '0.4.0'
end
group :development do
gem 'active_record_query_trace', '1.1'
end
Any help would be greatly appreciated, as I'm in pretty far over my head.
Well, I figured it out. The RAILS_ENV=production script/delayed_job stop command was executing in the current folder, which is the previous release. Since I was using rbenv to force Ruby 2.1.5, the gems for the previous release had not been installed for the current version of Ruby, which is why delayed_job was complaining. Running bundle install in the current directory fixed the issue.
I'm trying to push an Enki gem blog to Heroku and I'm getting an error
Could not find jquery-rails-2.0.0 in any of the sources
However, in the Gemfile I had
`gem 'jquery-rails'`
and I've never had a problem pushing an Enki blog with this setup before. Here's the full error message
Running: bundle install --without development:test --path vendor/bundle --binstubs bin/ --deployment
Fetching gem metadata from https://rubygems.org/.......
Could not find jquery-rails-2.0.0 in any of the sources
!
! Failed to install gems via Bundler.
!
! Heroku push rejected, failed to compile Ruby/rails app
After I got the error message I added this to the gemfile
gem 'jquery-rails-2.0.0'
I got this error message
Could not find gem 'jquery-rails-2.0.0 (>= 0) java' in the gems available on this machine.
I then tried to do
gem install jquery-rails
It gave me
Successfully installed jquery-rails-2.0.2
1 gem installed
Installing ri documentation for jquery-rails-2.0.2...
Installing RDoc documentation for jquery-rails-2.0.2...
But the push didn't work, same error
-----> Heroku receiving push
-----> Ruby/Rails app detected
-----> Installing dependencies using Bundler version 1.2.0.rc
Running: bundle install --without development:test --path vendor/bundle --binstubs bin/ --deployment
Fetching gem metadata from https://rubygems.org/.......
Could not find jquery-rails-2.0.0 in any of the sources
!
! Failed to install gems via Bundler.
!
! Heroku push rejected, failed to compile Ruby/rails app
this is the gemfile
source 'https://rubygems.org'
gem 'rails', '3.2.6'
gem 'heroku'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
# 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'
gem 'uglifier', '>= 1.0.3'
end
group :development, :test do
gem 'sqlite3'
end
group :production do
gem 'pg'
end
group :production do
gem 'thin'
end
platforms :jruby do
gem 'activerecord-jdbcsqlite3-adapter'
gem 'trinidad'
gem 'jruby-openssl'
end
gem 'jquery-rails'
#gem 'jquery-rails-2.0.0'
# Use unicorn as the web server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'ruby-debug'
# Bundle the extra gems:
gem 'RedCloth', '~> 4.2.9', :require => 'redcloth'
gem 'ruby-openid', :require => 'openid'
gem 'rack-openid', :require => 'rack/openid'
gem 'aaronh-chronic', :require => 'chronic' # Fixes for 1.9.2
gem 'coderay'
gem 'lesstile'
gem 'formtastic'
gem 'will_paginate', '~> 3.0.2'
gem 'exception_notification', '~> 2.5.2'
gem 'open_id_authentication'
# 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 'database_cleaner'
gem 'cucumber-rails', :require => false
gem 'cucumber-websteps', :require => false
gem 'factory_girl'
gem 'rspec'
gem 'nokogiri', '~> 1.5.0'
gem 'webrat'
end
group :development, :test do
gem 'rspec-rails'
end
I was getting this same error and fixed it using:
bundle update jquery-rails
In looking into it, it appears that jquery-rails 2.0.0 was yanked from rubygems: http://d.pr/i/cLms/1ReBI4U8 for whatever reason. So you (and I) likely happened to install jquery-rails when that gem was the most current version.
It's also wise to note that deleting your Gemfile.lock can be dangerous and not recommended in most cases. This causes all the latest versions of every gem without a version number in your Gemfile to be downloaded. If gems have been updated with API-breaking changes (happens more often than you might think), your app could break. But it also might not. Just be careful, run test cases if you have them. This has caused me more than one headache.
You can read a bit more about how bundler, Gemfile, and Gemfile.lock work (as well as guidance on how to properly upgrade certain gems) here: http://viget.com/extend/bundler-best-practices
Worked for me:
delete the Gemfile.lock
removed the rails version from the line => gem 'rails' (jquery was already without a v number)
run the command "bundle install"
run also "bundle update jquery-rails" to make sure everything is updated
IMPORTANT, commit the new .lock file => run the "git add ." and "git commit ..."
push everything
Update:
I am going through mhartl's Rails Tutorials and had to update jquery-rails, '2.0.1' in the Gemfile, to get the bundle update jquery-rails going.
Thanks,
Jatin
i had similar issue by changing in Gemfile jquery-rails-2.0.0 to 2.0.1 will solved my problem.
Michael,
I had to remove the version number from my jquery gem from 2.0.0 and let it pull the latest for this to work. I am on rails 3.2.8.rc2 and running on the cedar stack of heroku. Best of luck!
Mark
I'm a beginner programmer and I'm trying to run the Rails Server through my command line. I type in "rails server" in my command line, and receive this error:
Could not find gem 'sqlite3-ruby (= 1.2.5, runtime)' in any of the gem sources listed in your Gemfile.
Run `bundle install` to install missing gems.
After receiving this error, I run 'bundle install'. Once I run 'bundle install', I type in "rails server" in my command line and receive the same error:
Could not find gem 'sqlite3-ruby (= 1.2.5, runtime)' in any of the gem sources listed in your Gemfile.
Run `bundle install` to install missing gems.
Here's a copy of my GemFile:
source 'http://rubygems.org'
gem 'rails', '3.0.9'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3-ruby', '1.2.5', :require => 'sqlite3'
# Use unicorn as the web server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger (ruby-debug for Ruby 1.8.7+, ruby-debug19 for Ruby 1.9.2+)
# gem 'ruby-debug'
# gem 'ruby-debug19', :require => 'ruby-debug'
# Bundle the extra gems:
# gem 'bj'
# gem 'nokogiri'
# gem 'sqlite3'
# gem 'aws-s3', :require => 'aws/s3'
# 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 :development, :test do
# gem 'webrat'
# end
Can someone help me get my rails server up and running? Thanks!
try deleting the "1.2.5" in your gemfile so the line looks like:
gem 'sqlite3-ruby', :require => 'sqlite3'
then run
bundle install
again
I think I once got this error a long time ago - it had something to do with having sqlite.dll in my bin or lib folder in my computer's ruby dir or something like that. I think Michael Hartl's tutorial mentions something about it.
Have you tried just
gem 'sqlite3'
You might also want to confirm that your gem is properly installed in your environment:
gem list
You can also get more information about a specific gem:
gem specification sqlite3-ruby
I am assuming that you have no issues with installing other gems - that is, you don't need to set up a http_proxy environment variable for bundle install.
I've deployed my app to a remote machine using Capistrano and Passenger. The project is on GitHub, and I want to work on some bug fixes on my local machine. I've synced up everything, and branched to a new 'dev' branch on my local machine. When I try the simple rails server command I had been using while developing, I get errors relating to the gems bundled in my Gemfile, e.g. `require': no such file to load -- nokogiri/nokogiri (LoadError). But when I run bundle show nokogiri, it's present at /vendor/cache/ruby/1.9.1/gems/nokogiri-1.5.0.
Maybe this is just the wrong workflow entirely, but how do I get to a development mode on my local machine, so I can test changes before pushing them to the deployed app?
My Gemfile:
source 'http://rubygems.org'
gem 'rails', '3.0.10'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
# Use unicorn as the web server
# gem 'unicorn'
# Deploy with Capistrano
gem 'capistrano'
# To use debugger (ruby-debug for Ruby 1.8.7+, ruby-debug19 for Ruby 1.9.2+)
# gem 'ruby-debug'
# gem 'ruby-debug19', :require => 'ruby-debug'
# Bundle the extra gems:
gem 'nokogiri'
# gem 'sqlite3-ruby', :require => 'sqlite3'
gem 'nested_scaffold'
gem 'rest-client'
gem 'pony'
gem 'mail'
gem 'logger'
gem 'json'
gem 'gmail'
# 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 :development, :test do
# gem 'webrat'
# end
I suggest you delete .bundle directory (consider backing up whatever's inside .bundle/config first) and run your bundle install command again. You can do cat .bundle/config to echo its contents to your terminal (STDOUT).
Make sure you have chosen the correct gemset by doing rvm gemdir and gem list to see all the gems in the current gemset.
Start your server with rails s -e development (s is short for server)
I have several gems including ruby-debug in a bundler group called :development. When I run the bundle command, these gems are ignored and it only installs the gems that are not in any group. How can I make sure bundler doesn't ignore the gems in the :development group?
Edit: This is what my Gemfile looks like.
source 'http://rubygems.org'
gem 'rails', '3.0.1'
# Auth gems
gem "devise", "1.1.3"
gem "omniauth"
# Bundle Mongoid gems
gem "mongoid", "2.0.0.beta.19"
gem "bson_ext"
# Asset gems
gem 'jquery-rails'
gem "jammit"
# Controller gems
gem 'inherited_resources', '1.1.2'
# View gems
gem 'haml'
gem 'formtastic', '~> 1.1.0'
# Nokogiri
gem "mechanize"
gem "json"
group :development do
gem "ruby-debug"
gem 'compass'
gem 'compass-colors'
gem 'pickler'
gem 'haml-rails'
gem 'rails3-generators'
gem "hpricot"
gem "ruby_parser"
gem 'fog'
end
Within a term session, it remembers the without option. If you first ran
bundle install --without development
it remembers that you did this and will automatically repeat this for the next
bundle install #remembers and includes --without development
running something else, like bundle install --without nothing should clear the cache. Am I right?
update 20150214: This is fixed in bundler 2.0, according to issue referenced in comment by #Stan Bondi (https://github.com/bundler/bundler/issues/2862). Thanks Stan.
If you are using rails, there will be a file config written into a hidden dir called .bundle in your rails root directory:
.bundle/config
This file, in my case, held exactly the without settings.
So I just deleted the .bundle directory:
rm .bundle -r
After that:
bundle install worked again as expected.
Using: bundler (1.5.2)
I had the same issue and --with flag worked for me. You need to pass group name, which you want to include. Like that:
bundle install --with development
gem 'aws-s3'
gem 'paperclip'
group :test do
gem 'rspec'
gem 'waitr'
gem 'faker'
end
gem 'rest-client', :group => :development
gem 'cucuber-rails', :groups => [:development,:test] (cucuber-rails gems comes under both group)
bundle install --without development #(ignore development group gems)
bundle install #(still bundle remembers --without development so result is still ignore development groups it will not install all gems)
bundle install --without nothing #(just clearing cache, now all the gems to be loaded into the ruby loadpath)
More
In fact Rails loads the :development group automatically when in development environment. Check whether Rails.env in you App really returns "development".
More Information about groups in Bundler:
http://gembundler.com/groups.html
I had a similar problem - thin in staging ignored - and the solution was to put it out if staging into the 'global' space:
gem 'thin'
group :production do
gem 'puma'
end
I've faced the same issue with bundler 2.1.4 When I checked my .bundle/config it has
---
BUNDLE_PATH: "vendor/bundle"
BUNDLE_WITHOUT: "development:test:build"
Remove groups from there and add BUNDLE_WITH to your groups.
BUNDLE_WITH: "development"
I've removed the ~/.bundle/config. but there was a file in my project directory. .bundle/config. Local directory files have precedence over the main config files.
If you can't figure out the reason, then you can just create a file in your project directory .bundle/config. and add this content there
BUNDLE_WITH: "development:test:anyGroupYouWant"