Msfconsolethere Was an Error in Your Gemfile and Bundler Cannot Continue

error in your Gemfile, and Bundler cannot continue

Solution 1

You're running Ruby 1.8 and the syntax attribute: requires ruby 1.9. You will need to change

            gem 'cucumber-rails', '1.2.1', require: false                      

to

            gem 'cucumber-rails', '1.2.1', :require => false                      

Or install Ruby 1.9 (maybe using RVM or rbenv) and run bundle install again. This would be a much bettter option if it's a new project.

Solution 2

I got the same error after updating up my Ruby/Rails environment.

gem update bundler fixed it.

Solution 3

I just had a similar issue while using rvm. Here is what worked for me:

Check to see what version of rails you are using with rvm (in terminal): ruby -v (in my case opened a new terminal with version set to ruby 1.8.7, yours may not be)

Switch to the correct ruby version (In my case it should be ruby 2.1.1, yours may not be): rvm 2.1.1 (this sets the ruby version to 2.1.1, replace with your project's ruby x.x.x)

Try re-running bundle check: bundle check

You should get: The Gemfile's dependencies are satisfied

Related videos on Youtube

Comments

  • I just setup my mac for development and used this exact gemfile previously and it worked fine. I am not sure what I am doing wrong.

                        Victorias-MacBook-Pro:sample_app Victoria$  bundle --without production /Users/Victoria/Sites/sample_app/Gemfile:38:in `evaluate': compile error /Users/Victoria/Sites/sample_app/Gemfile:28: syntax error, unexpected ':', expecting kEND   gem 'cucumber-rails', '1.2.1', require: false                                          ^ (SyntaxError)        /Library/Ruby/Gems/1.8/gems/bundler-1.1.3/lib/bundler/definition.rb:18:in `build'        /Library/Ruby/Gems/1.8/gems/bundler-1.1.3/lib/bundler.rb:135:in `definition'        /Library/Ruby/Gems/1.8/gems/bundler-1.1.3/lib/bundler/cli.rb:220:in `install'        /Library/Ruby/Gems/1.8/gems/bundler-1.1.3/lib/bundler/vendor/thor/task.rb:22:in `send'        /Library/Ruby/Gems/1.8/gems/bundler-1.1.3/lib/bundler/vendor/thor/task.rb:22:in `run'        /Library/Ruby/Gems/1.8/gems/bundler-1.1.3/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'        /Library/Ruby/Gems/1.8/gems/bundler-1.1.3/lib/bundler/vendor/thor.rb:263:in `dispatch'        /Library/Ruby/Gems/1.8/gems/bundler-1.1.3/lib/bundler/vendor/thor/base.rb:386:in `start'        /Library/Ruby/Gems/1.8/gems/bundler-1.1.3/bin/bundle:13        /usr/bin/bundle:19:in `load'        /usr/bin/bundle:19 There was an error in your Gemfile, and Bundler cannot continue.                                      

    This is the gemfile

                        source 'https://rubygems.org'  gem 'rails', '3.2.3' gem 'jquery-rails', '2.0.0' gem 'bootstrap-sass', '2.0.0' gem 'bcrypt-ruby', '3.0.1' gem 'faker', '1.0.1' gem 'will_paginate', '3.0.3' gem 'bootstrap-will_paginate', '0.0.5'  group :development, :test do   gem 'mysql2'   gem 'rspec-rails', '2.9.0'   gem 'guard-rspec', '0.5.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'   gem 'uglifier', '1.2.3' end  group :test do   gem 'capybara', '1.1.2'   gem 'factory_girl_rails', '1.4.0'   gem 'cucumber-rails', '1.2.1', require: false   gem 'database_cleaner', '0.7.0'   gem 'guard-spork', '0.3.2'     gem 'spork', '0.9.0'   # gem 'rb-fsevent', '0.4.3.1', require: false   # gem 'growl', '1.0.3' end  group :production do   gem 'pg', '0.12.2' end                                      
    • what version of ruby do you use?

  • Make sure the bundle executable doesn't have system ruby (which is 1.8) in the shebang. Do cat $(which bundle) to check. This happened to me when I installed bundler using system ruby, then installed it via RVM in ruby 1.9.

  • I had the same issue as Zubin, on this box someone had installed bundler several times in different gemsets all somehow while using the system ruby. I had to uninstall it from the gemset i was using, switch to the global gemset and uninstall it again, then after running "bundler" gives you the 'bundler is not installed' message, switch into the right gemset again, and gem install bundler. hope this is helpful to someone in the future.

  • @XP84 what do you guys mean by 'system ruby'? how many kinds of ruby are out there?

  • @Zubin I followed your advice.. but the system returns this stuff, didn't make much sense to me.. can you please explain further?

  • @abbood if you are on a different ruby, simply installing bundler again for that ruby should fix the issue. If you are using rbenv that simply means gem install bundler && rbenv rehash. If you are using RVM you're probably using gemsets and installing it for that gemset should do the trick. If that doesn't help, better post a new question.

  • @abbood system ruby is the version which ships with Mac OS X (Windows doesn't include ruby). The shell command cat $(which bundle) outputs the bundle command's source. The first line is the "shebang", which tells the system which ruby to execute the script with. Mine is #!/usr/bin/env bash. Try changing yours to that (use which bundle to locate the file).

Recents

Related

bruntheaut.blogspot.com

Source: https://9to5answer.com/error-in-your-gemfile-and-bundler-cannot-continue

0 Response to "Msfconsolethere Was an Error in Your Gemfile and Bundler Cannot Continue"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel