Ruby on rails 为什么在使用Ruby安装程序更新之后Ruby没有更新?

Ruby on rails 为什么在使用Ruby安装程序更新之后Ruby没有更新?,ruby-on-rails,ruby,shopify-app,railsinstaller-windows,Ruby On Rails,Ruby,Shopify App,Railsinstaller Windows,我目前在Windows 10计算机上安装了Ruby 2.2.6版,但需要更新订单才能使用shopify_应用程序gem。我下载了Ruby 2.5.1-2(x64),没有Ruby安装程序站点上所说的devkit,并按照提示进行了操作。我似乎已经完成了安装,但在命令行中输入ruby-v告诉我仍然在使用2.2.6版。我还尝试了bundle update,它提供了以下内容: C:\Sites\postgresapp>bundle update The dependency byebug (>

我目前在Windows 10计算机上安装了Ruby 2.2.6版,但需要更新订单才能使用shopify_应用程序gem。我下载了Ruby 2.5.1-2(x64),没有Ruby安装程序站点上所说的devkit,并按照提示进行了操作。我似乎已经完成了安装,但在命令行中输入
ruby-v
告诉我仍然在使用2.2.6版。我还尝试了
bundle update
,它提供了以下内容:

C:\Sites\postgresapp>bundle update
The dependency byebug (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for x86-mingw32 but the dependency is only for ruby. To add those platforms to the bundle, run `bundle lock --add-platform ruby`.
Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies........
Using rake 12.3.1
Using concurrent-ruby 1.0.5
Using i18n 1.0.1
Using minitest 5.11.3
Using thread_safe 0.3.6
Using tzinfo 1.2.5
Using activesupport 5.0.7
Using builder 3.2.3
Using erubis 2.7.0
Using mini_portile2 2.3.0
Using nokogiri 1.8.4 (x86-mingw32)
Using rails-dom-testing 2.0.3
Using crass 1.0.4
Using loofah 2.2.2
Using rails-html-sanitizer 1.0.4
Using actionview 5.0.7
Using rack 2.0.5
Using rack-test 0.6.3
Using actionpack 5.0.7
Using nio4r 2.3.1
Using websocket-extensions 0.1.3
Using websocket-driver 0.6.5
Using actioncable 5.0.7
Using globalid 0.4.1
Using activejob 5.0.7
Using mini_mime 1.0.0
Using mail 2.7.0
Using actionmailer 5.0.7
Using activemodel 5.0.7
Using activemodel-serializers-xml 1.0.2
Using arel 7.1.4
Using activerecord 5.0.7
Using activeresource 5.0.0
Using bindex 0.5.0
Using bundler 1.16.2
Using coffee-script-source 1.12.2
Using execjs 2.7.0
Using coffee-script 2.4.1
Using method_source 0.9.0
Using thor 0.20.0
Using railties 5.0.7
Using coffee-rails 4.2.2
Using multipart-post 2.0.0
Using faraday 0.12.2
Using ffi 1.9.25 (x86-mingw32)
Using graphql 1.8.5
Using graphql-client 0.13.0
Using hashie 3.5.7
Using multi_json 1.13.1
Using jbuilder 2.7.0
Using jquery-rails 4.3.3
Using jwt 1.5.6
Using multi_xml 0.6.0
Using oauth2 1.4.0
Using omniauth 1.8.1
Using omniauth-oauth2 1.5.0
Using omniauth-shopify-oauth2 1.2.1
Using pg 0.21.0 (x86-mingw32)
Using puma 3.12.0
Using sprockets 3.7.2
Using sprockets-rails 3.2.1
Using rails 5.0.7
Using rb-fsevent 0.10.3
Using rb-inotify 0.9.10
Using sass-listen 4.0.0
Using sass 3.5.7
Using tilt 2.0.8
Using sass-rails 5.0.7
Using shopify_api 4.12.0
Fetching shopify_app 8.2.6
Installing shopify_app 8.2.6
Gem::InstallError: shopify_app requires Ruby version >= 2.3.1.
An error occurred while installing shopify_app (8.2.6), and Bundler cannot
continue.
Make sure that `gem install shopify_app -v '8.2.6' --source
'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
  shopify_app
编辑:添加文件

source 'https://rubygems.org'

git_source(:github) do |repo_name|
  repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
  "https://github.com/#{repo_name}.git"
end

gem 'shopify_app', '~> 8.2.6'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.0.6'
# Use postgresql as the database for Active Record
gem 'pg', '~> 0.18'
# Use Puma as the app server
gem 'puma', '~> 3.0'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'
# 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', '~> 3.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

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


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

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

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
"gem 'shopify_app'"
源代码'https://rubygems.org'
git_源(:github)do | repo_名称|
repo_name=“#{repo_name}/#{repo_name}”除非repo_name.include?(“/”)
"https://github.com/#{repo_name}.git“
结束
gem'shopify_app',“~>8.2.6”
#捆绑边缘Rails:gem'Rails',github'Rails/Rails'
gem'rails',“~>5.0.6”
#使用postgresql作为活动记录的数据库
宝石'pg','~>0.18'
#使用Puma作为应用程序服务器
宝石“彪马”,“~>3.0”
#将SCS用于样式表
gem'sass-rails',“~>5.0”
#使用Uglifier作为JavaScript资产的压缩器
gem'uglifier','>=1.3.0'
#将CoffeeScript用于.coffee资产和视图
gem“咖啡轨”,“~>4.2”
#看https://github.com/rails/execjs#readme 获取更多受支持的运行时
#宝石“therubyracer”,平台::ruby
#使用jquery作为JavaScript库
gem'jqueryrails'
#Turbolinks使web应用程序的导航速度更快。阅读更多:https://github.com/turbolinks/turbolinks
gem“涡轮链接”,“大于5”
#轻松构建JSON API。阅读更多:https://github.com/rails/jbuilder
gem'jbuilder',“~>2.5”
#使用Redis适配器在生产中运行操作电缆
#gem'redis',“~>3.0”
#使用ActiveModel具有\u安全\u密码
#gem'bcrypt',“~>3.1.7”
#使用Capistrano进行部署
#gem“capistrano rails”,集团::开发
创业板“简单形式”
小组:开发,:测试
#在代码中的任意位置调用“byebug”以停止执行并获得调试器控制台
gem'byebug',平台::mri
结束
小组:发展怎么办
#在异常页面上或通过使用代码中的任意位置访问IRB控制台。
gem“web控制台”,“>=3.3.0”
结束
#Windows不包括zoneinfo文件,因此捆绑tzinfo数据
gem'tzinfo data',平台:[:mingw,:mswin,:x64_mingw,:jruby]
“gem‘shopify_应用程序’”

如何完成最新版本Ruby的安装?

您需要更新
PATH
环境变量,它仍然指向旧安装。如果我没记错的话,安装程序确实有一个复选框来设置
PATH
变量。一次只能在
路径中安装一个

有关更改变量的快速方法,请参见。它将遵循与下面相同的语法

打开
cmd.exe
并键入:

set PATH=%PATH%;C:\Ruby250\bin
您的安装位置可能不同,请在进入前确认。你也可以通过
MyComputer
的属性窗口或者他们现在所说的任何东西来完成。我发现终端更简单,因为通过GUI更改大约需要6个窗口

逐步:

  • 查找ruby安装到的目录,通常是
    C:\Ruby250\bin
    (版本可能不同)
  • 打开命令提示符、终端、
    cmd.exe
    ,或任何您需要的名称 我宁愿叫它
  • 类型
    设置路径=%PATH%;C:\Ruby250\bin
    (如果您的文件夹名为 (不一样)
  • Enter
    按钮
  • 在新的
    cmd.exe
    中,键入
    ruby-v
  • 享受
另一次编辑

  • 点击“开始”按钮(可能是屏幕左下角)
  • 开始键入单词“environment”,直到看到选项
    Edit
    此时将显示系统环境变量
  • 点击那个
  • 将打开一个小窗口,左下角有一个按钮 读取环境变量
  • 点击那个按钮
  • 将有两个部分,一个为用户(即活期账户 另一个是“系统”,它是默认值和 全系统变量
  • 在每一个选项中(为了确保),突出显示 变量名称的“路径”
  • 在您刚刚单击的列表下找到如下按钮:
    编辑…
  • 点击它
  • 通过列表查看,每个人的情况都不一样,无法阅读 你。找到Ruby安装的位置, 我的代码是
    C:\Ruby24\bin
    ,因为我使用的是Ruby 2.4.4
  • 您需要确保文件夹路径是您安装的位置 红宝石。这不能为你做,只有你知道。这是默认的
    C:\RUBY***\bin
    ,其中
    ***
    是您的版本号。你必须 打开资源管理器,只需查看
  • 如果变量是安装Ruby 2.5的位置,那么很好,它 不需要更改,但请查看列表以确保有 没有其他路径指向其他版本的Ruby。如果有,突出显示 然后单击“删除”按钮将其删除
  • 在可能已进行编辑的每个窗口上单击
    OK
    ,而不是
    取消
    ,而不是将X移出窗口
  • 若要确认其工作,请打开一个新的命令窗口(如果已打开) 打开时,更改将不会在其中更新

  • 我读过这个答案,但我不明白。这是省略步骤。我在安装中没有看到任何关于路径变量的内容。这条路是什么?我一步一步地加上。如果失败,google
    更改路径环境变量
    ,将有数千条带图片的在线指令。有多种方法可以更改它。步骤1:你是说旧版本安装到哪里,还是我刚下载的新版本安装到哪里?我如何找到目录?第3步:当您说“更改文件夹名称”时,“设置路径=%PATH%的哪一部分?”;C:\Ruby250\bin“我需要更改哪些内容?”?如果你能填补这些空白,我会的