Complete new person to Ruby and Rails here... Have tried some tutorials in the past, but that's about it. I'm trying to follow 'Ruby on Rails 3 Tutorial' book and have hit a roadblock that I haven't been able to find any help for after searching on here and the Google..
I haven't actually done anything yet; only:
rails new first_app
then changed the Gemfile sqlite3 to
gem 'sqlite3-ruby', '1.2.5', :require => 'sqlite3'
When I run 'bundle install' I get the following:
Fetching gem metadata from http://rubygems.org/.........
Bundler could not find compatible versions for gem "bundler":
In Gemfile:
rails (= 3.0.1) ruby depends on
bundler (~> 1.0.0) ruby
Current Bundler version:
bundler (1.1.3)
This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?
I've tried uninstalling the bundler via
gem uninstall bundler -v 1.1.3
and then installing bundler v1.0.0 via
gem install bundler -v 1.0.0
but it seems to get me bundler 1.1.2..
I just feel like I've hit a dead end and can't find any more information on how to solve this issue.
Any help would be greatly appreciated and rewarded with copious amounts of bacon...
UPDATE UPDATE UPDATE
I couldn't get bundler v 1.1.2 to uninstall. I finally was able to uninstall all of the gems by doing:
sudo gem list | cut -d" " -f1 > gem_list.txt
cat gem_list.txt | xargs sudo gem uninstall -aIx
cat gem_list.txt | xargs sudo gem install
And then reinstalling... This allowed me to then do the 'bundle install' and get on track.. Thank you all for your help!
it is because gems are also installed in global gemset, and you can uninstall it using:
rvm #global do gem uninstall bundler
but you can also use the other version of bundler using:
gem install bundler -v '~>1.0.0'
bundle _1.0.0_ install
replace 1.0.0 with the version that got installed (if other)
First verify your versions to be sure they're all current:
$ ruby -v
ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-linux]
$ rails -v
Rails 3.2.2
$ gem list bundler
*** LOCAL GEMS ***
bundler (1.1.3)
If you need to update ruby, you can download it from https://www.ruby-lang.org or use tools like ruby-build. If you have any version of Ruby 1.9.3 that's fine for now.
To update all your gems:
gem update --system
gem update
Gem may install gems in a few different places, and these can interfere with each other. There are system gems (typically installed by root or by using sudo) and your personal user gems. My favorite way to manage these is with a simple tool called rbenv. A related tool is rvm. Either is fine.
For your first tutorial, you can skip using version numbers in your Gemfile:
- gem 'sqlite3-ruby', '1.2.5', :require => 'sqlite3'
+ gem 'sqlite3-ruby', :require => 'sqlite3'
Bundler will sort everything out the right way. Eventually you'll want to specify version numbers if you're coordinating with other developers, or building production systems.
Feel free to ask questions here and I'll add to this answer.
Maybe you had bundler 1.1.2 AND 1.1.3 installed on your machine (and possibly more versions)
use
gem list bundler
to check which version(s) of bundler you have installed.
Then remove the ones you don't want with
gem uninstall bundler -v VERSION_NUMBER
You can use latest version of Rails 3.0 (3.0.12). It supports the latest bundler, and isn't fundamentally different from 3.0.1
I had this problem and the source was a version specification for bundler in the .gemspec file:
spec.add_development_dependency "bundler", "~> 1.16"
Removing the version number solved the issue:
spec.add_development_dependency "bundler"
Bundler is a dependent gem of rails, because of which you can see it only in gemfile.lock instead of gemfile.
For a particular rails version only a range of bundler gems are compatible. I also got this error and I tried uninstalling that version of bundler gem which I didn't need. I also tried to install forcefully using bundle_x.x.x_install, but when things didn't work I explicitly mentioned the gem specifying the version falling within the range required by rails version I am using. May be it's not the right way but that is how things worked for me.
Sometimes to fix the issue mentioned in the title of this question it is enough to delete Gemfile.lock and run bundle update. I hope it will be helpful for someone.
Related
I am trying to set up RedMine on Ubuntu 14.04.5 LTS machine and in the end of install have following error:
Redmine requires Bundler 1.5.0 or higher (you're using 1.3.5).
Please update with 'gem update bundler'. (SystemExit)
However, gem update bundlergives me following:
gem update bundler
Updating installed gems
Nothing to update
Moreover:
$ bundle -v
Bundler version 1.15.3
$ gem list | grep bundler
bundler (1.15.3)
I am totally stuck.
Could anybody tell me how to fix it?
I've tried to remove Bundler version check in Gemfile. Then I have following error:
`x64_mingw` is not a valid platform. The available options are: [:ruby, :ruby_18, :ruby_19, :ruby_20, :mri, :mri_18, :mri_19, :mri_20, :rbx, :jruby, :mswin, :mingw, :mingw_18, :mingw_19, :mingw_20] (Bundler::GemfileError)
I've checked solutions here: http://www.redmine.org/issues/19409 and here http://www.redmine.org/issues/19469 - nothing helps...
After this steps: Redmine installation : Error
I have cannot load such file -- bundler/setup (LoadError) error. But bundler is installed and still have version 1.15.3
Please help. I am totally disappointed with these errors.
Sorry for my english.
Try
bundle clean
to remove all bundled gems
Then
bundle install
to install required gems
Edit:
After seeing your new error, look at this answer:
'x64_mingw' is not a valid platform
And this RedMine board post:
http://www.redmine.org/boards/2/topics/45759
An updated bundler gem should be ok, but also check your Gemfile and remove any reference to x64_mingw before running bundle install
I am new to ruby on rails and trying to install the bundle in my rails app and getting the same error this whole time ..
Bundler could not find compatible versions for gem "bundler":
In Gemfile:
bundler (= 1.0.18) ruby
Current Bundler version:
bundler (1.7.4)
This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running gem install bundler?
I have tried almost each suggestions that've been suggested but none so far worked for me.
Can anybody help..??
Thank you in advance..
Usually, Bundler does not need to be on Gemfile.
You can remove the line that contains bundler in Gemfile, then run bundle again.
The reason this is failing is because your system has probably a newer version of bundler than the Gemfile is asking for.
Bundler could not find compatible versions for gem "bundler":
In Gemfile:
bundler (~> 1.3.5) ruby
Current Bundler version:
bundler (1.2.3)
This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running gem install bundler?
Above is the error that i am getting,already tried running 'gem install bundler'. It ran successfully,but bundle install is always throwing this error.Although its a dependancy gem,i have explicitly mentioned bundler gem in gemfile with the version 1.3.5,still getting the same error.Plz reply if anyone has come across such error or help me understand if i am doing something wrong.
you can force the bundler version in bundle install command like this:
bundle _1.2.3_ install.
I've created a gem, and for some reason this one keeps bugging me, and refuses to install properly through bundler.
Here's the Gemfile:
source 'https://rubygems.org'
gem 'rails', '3.2.9'
gem "switch_access-rails", "~> 1.1.6"
bundle install fails with:
Could not find gem 'switch_access-rails (~> 1.1.6) ruby' in the gems available on this machine.
This works:
gem install switch_access-rails -v 1.1.6
And the gem is here on rubygems: https://rubygems.org/gems/switch_access-rails/versions/1.1.6
I even tried bumping from version 1.1.5 to 1.1.6 just to see if that helped.
Installing version 1.1.4 in with bundle install works.
Any tips on where to start looking/debugging bundle install?
And after a whole day of googling I found this status update from Dec 12: http://twitter.com/rubygems_status/status/279019743166476288
bundle install --full-index
Seems to get the index directly from rubygems instead of from a cloudfront cache.
I had a look at the index, and there is quite a diffence in the two indexes, so if you just released a gem or use a newly released gem, you might have to add --full-index in order to get the proper index.
Do you have rubygems listed as a remote source?
Your Gemfile should have source :rubygems at the top of the file, and $ gem sources should return at a minimum:
*** CURRENT SOURCES ***
http://rubygems.org/
If it's not listed, you can add it with $ gem sources -a http://rubygems.org
I'm having issues with the libv8 gem with ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin10.8.0]. gem install libv8 works fine and I have
gem 'therubyracer'
in my Gemfile and this has a dependency on libv8 which is installed when I do a bundle install:
$ bundle exec gem list
*** LOCAL GEMS ***
actionmailer (3.1.3)
actionpack (3.1.3)
...
libv8 (3.3.10.4 x86_64-darwin-10)
...
but when I run:
$ rails s
Could not find libv8-3.3.10.4 in any of the sources
Run `bundle install` to install missing gems.
it can't find libv8 - is this is a 32/64 bit issue? If so, how do I solve it?
I suspect this was because I had a 32/64 bit mismatch.
I solved this with the following:
$ irb
ruby-1.9.3-p0 :001 > `gem list`.each_line {|line| `sudo env ARCHFLAGS="-arch x86_64" gem install #{line.split.first}`
I had a similar problem deploying from an x86 dev box to an x86_64 server (using capistrano)
When I did the deployment, I got the same 'Could not find libv8-3.3.10.4 in any of the sources' message. This is because running 'bundle pack' on an x86 machine only copies the x86 gem into the /vendor/cache directory!
I fixed this by explicitly adding the linux x86_64 gem file to the /vendor/cache directory, so that it would agree with the deployment server architecture. Deployment ran fine after that.
Another solution is to use nodejs instead of therubyracer. You install it on the server using apt-get/yum, so there's no need for your Gemfile to include execjs or therubyracer.
You can actually install that version on Mavericks:
gem install libv8 -v 3.11.8.17 -- --with-system-v8
You can provide whatever libv8 gem version you want to install ..
After this you might facing issue with installing therubyracer then
Update Version of Gemfile to point to the last version like so:
gem "therubyracer", "~> 0.10.2"
and I was able to successfully install the gem.
If you want to manually install the gem, you can use:
gem install therubyracer --version "~> 0.10.2"
Have you tried bundle exec rails s? It's possible that there's a conflict between the gems you have installed on your system and the gems that are required for your project to run.
I resolved this issue by installing nodejs (latest version). What it does is that it installs the libv8 -dev library along with it. Thus rather than installing the gem what you require is the native library.
You can install it directly or install nodejs as well in your system and the above error should be resolved.