0

I am getting the next error after running the command rails generate model Setting target:text.

Bundler could not find compatible versions for gem "bundler":
  In Gemfile:
    rails (= 4.1.6) depends on
      bundler (< 2.0, >= 1.3.0)

  Current Bundler version:
    bundler (1.0.15)

This means that it is listing a bundler version that doesn’t seem to be installed on my machine.

Some details:

Ubuntu 12.0.4

$ bundle -v
Bundler version 1.7.12
$ruby -v
ruby 1.9.3p0 (2011-10-30 revision 33570) [i686-linux]
$ gem -v
2.4.5
$bundle exec rails -v
Rails 4.1.6
$ which ruby -a
/usr/bin/ruby

I have already tried:

  • bundle exec before the command

  • bundle install

  • bundle update
  • uninstalling libv8
  • updating the bundler version
  • bundle _1.7.12_ install and bundle _1.7.12_

And checked similar questions like this and this without luck.

bundle exec rails s works, but without bundle exec it shows the same error.

Right now I am unable to use models on my application, does anyone know what can I do?

Community
  • 1
  • 1
Str1101
  • 859
  • 2
  • 12
  • 22

1 Answers1

0

Your Issue:

 In Gemfile:
    rails (= 4.1.6) depends on
      bundler (< 2.0, >= 1.3.0)

  Current Bundler version:
    bundler (1.0.15)

Your rails 4.1.6 needs bundler having version >= 1.3.0 But your current bundler version is 1.0.15. Give a try removing your Gemfile.lock file

gem install bundler 
#let's say it installed 1.7.2 Version for you. 
bundle _1.7.12_ --version
bundle install
rails generate model setting target:string
Ajay
  • 4,199
  • 4
  • 27
  • 47
  • 1
    I have tried but it is still returning the same error. The version of bundler is 1.7.12 but keeps saying it's 1.0.15. – Str1101 Jan 21 '15 at 17:04