简体   繁体   English

您的Ruby版本是2.5.1,但您的Gemfile指定了2.6.3

[英]Your Ruby version is 2.5.1, but your Gemfile specified 2.6.3

I'm trying to run command " rake db:test:prepare" in 6.2 of Rails Tutorial book. 我正在尝试在Rails教程6.2中运行命令“ rake db:test:prepare”。 And then I had this problem 然后我有这个问题

I have already run " gem install bundler". 我已经运行了“ gem install bundler”。 But it wasn't work. 但这是行不通的。 After I check version in path /home/myname/.rvm/gems. 在检查路径/home/myname/.rvm/gems中的版本之后。 T got version of Ruby is 2.6.3 Ruby的版本是2.6.3

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

ruby '2.6.3'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.2.3'
# Use mysql as the database for Active Record
gem 'mysql2', '>= 0.4.4', '< 0.6.0'
# Use Puma as the app server
gem 'puma', '~> 3.11'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'mini_racer', platforms: :ruby

# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# 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.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use ActiveStorage variant
# gem 'mini_magick', '~> 4.8'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.1.0', 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'
  gem 'listen', '>= 3.0.5', '< 3.2'
  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring'
  gem 'spring-watcher-listen', '~> 2.0.0'
  gem 'annotate', '~> 2.7', '>= 2.7.5'
  gem 'rspec-rails', '~> 3.8', '>= 3.8.2'
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 chromedriver to run system tests with Chrome
  gem 'chromedriver-helper'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
# group :production do
#   gem 'pg',             '0.17.1'
#   gem 'rails_12factor', '0.0.2'
# end

How can i fix this problem? 我该如何解决这个问题? Thank you. 谢谢。

This usually comes up when the specified ruby version is not installed. 当未安装指定的ruby版本时,通常会出现这种情况。 To install using rvm run: 要使用rvm安装,请运行:

rvm install ruby-2.6.3

If you suspect it's already installed, then you may need to tell rvm to use the specific version, as it might default to another version (in this case 2.5.1). 如果您怀疑它已经安装,则可能需要告诉rvm使用特定版本,因为它可能默认为另一个版本(在本例中为2.5.1)。 To do that run: 为此,请执行以下操作:

rvm --default use ruby-2.6.3

If it's not installed, the above command will throw a relevant error. 如果未安装,则上述命令将引发相关错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 您的Ruby版本是2.5.1,但您的Gemfile指定了2.4.0 - Your Ruby version is 2.5.1 but your Gemfile specified 2.4.0 您的 Ruby 版本是 2.3.1,但您的 Gemfile 指定了 2.5.1 - Your Ruby version is 2.3.1 but your Gemfile specified 2.5.1 如何解决“您的 Ruby 版本是 2.5.3,但您的 Gemfile 指定 2.5.1”部署 AWS eb? - How to fix "Your Ruby version is 2.5.3, but your Gemfile specified 2.5.1" deploying the AWS eb? 修复rbenv和rails 5.2的“您的Ruby版本为2.4.4,但您的Gemfile指定了2.5.1”的错误 - Fixing 'Your Ruby version is 2.4.4, but your Gemfile specified 2.5.1' error with rbenv and rails 5.2 您的Ruby版本是2.3.1,但是您的Gemfile指定了2.3.1(相同版本) - Your Ruby version is 2.3.1, but your Gemfile specified 2.3.1 (same version) 您的Ruby版本是2.3.0,但您的Gemfile指定为2.1.2 - Your Ruby version is 2.3.0, but your Gemfile specified 2.1.2 rbenv您的Ruby版本是2.0.0,但您的Gemfile指定为2.1.2 - rbenv Your Ruby version is 2.0.0, but your Gemfile specified 2.1.2 您的 Ruby 版本是 2.7.0,但您的 Gemfile 指定了 2.7.1 - Your Ruby version is 2.7.0, but your Gemfile specified 2.7.1 您的 Ruby 版本是 2.3.1,但您的 Gemfile 指定了 2.1.4 - Your Ruby version is 2.3.1, but your Gemfile specified 2.1.4 您的Ruby版本是1.9.3,但是您的Gemfile指定了2.2.2 - Your Ruby version is 1.9.3, but your Gemfile specified 2.2.2
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM