skip to Main Content

When i execute "bundle install" this happen: Your Ruby version is 2.3.3, but your Gemfile specified 2.7.1 What i can do? I’m using my pc, Git Bash and Visual Studio

Error here

My Gemfile:

source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '2.7.1'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 6.0.3', '>= 6.0.3.3'
# Use sqlite3 as the database for Active Record
gem 'sqlite3', '~> 1.4'
# Use Puma as the app server
gem 'puma', '~> 4.1'
# Use SCSS for stylesheets
gem 'sass-rails', '>= 6'
# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
gem 'webpacker', '~> 4.0'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.7'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use Active Model has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use Active Storage variant
# gem 'image_processing', '~> 1.2'

# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.4.2', require: false

group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
end

group :development do
  # Access an interactive console on exception pages or by calling 'console' anywhere in the code.
  gem 'web-console', '>= 3.3.0'
end

group :test do
  # Adds support for Capybara system testing and selenium driver
  gem 'capybara', '>= 2.15'
  gem 'selenium-webdriver'
  # Easy installation and use of web drivers to run system tests with browsers
  gem 'webdrivers'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

I didnt make any change

2

Answers


  1. You’ll need to install ruby version 2.7.1 on your machine to proceed.

    Alternatively, you could change the ‘ruby-version’ specified in the Gemfile to match what you have (2.3.3). That’s a pretty major change and it’s possible the project will not work with such an old version.

    Are you using a ruby-version manager? Where did this Gemfile come from?

    If this is because you did rails new to start a new rails project, it’s likely that you’ll want to run with a ruby version that’s more modern than 2.3.3 which means (as I said on the first line), you’ll need to upgrade your system’s default ruby.

    Login or Signup to reply.
  2. I thought that you could follow this tutorial https://medium.com/ruby-on-rails-web-application-development/how-to-install-rubyonrails-on-windows-7-8-10-complete-tutorial-2017-fc95720ee059, when you get ruby 2.7.1 you could start ok with no problem.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search