【问题标题】:Upgrading to Rails 5.0 - updating gem file / gemfile.lock升级到 Rails 5.0 - 更新 gem 文件 / gemfile.lock
【发布时间】:2017-05-05 10:38:33
【问题描述】:

我有一个现有的应用程序,我希望将它从 rails 4.2.5 更新到 Rails 5.0(还没有做 5.1)和 ruby​​ 2.3.0 到 2.4.0。我正在尝试更新 gemfile,但遇到了一些我认为与我的 gemfile.lock 相关的依赖问题。这是我的命令行的快照-

这是我的 gemfile -

     source 'https://rubygems.org'

     ruby '2.4.0'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '5.0.1'
gem 'railties', '~> 5.0'
gem 'actionpack', '~> 5.0.1', '>= 5.0.1'
gem 'rails-dom-testing', '~> 2.0', '>= 2.0.2'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# 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 following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc

gem 'bootstrap-sass', '~> 3.3', '>= 3.3.6'
# for styling - not happy but best for grid usage I need (I hope!!)

gem 'simple_form', '~> 3.2', '>= 3.2.1'
# for building form templates on the site

gem 'devise', '~> 4.0'
# for creating sign-in / sign-up process

gem 'paperclip', '~> 4.3', '>= 4.3.2'
# for using images on the site

gem 'jquery-ui-rails', '~> 5.0', '>= 5.0.5'
# Adding Datepicker

gem 'jquery-turbolinks', '~> 0.2.1'
# to fix problems with turbolinks

gem 'stripe', '~> 1.38'
# for payments / bookings

gem 'omniauth', '~> 1.3', '>= 1.3.1'
gem 'omniauth-twitter', '~> 1.2', '>= 1.2.1'
gem 'omniauth-facebook', '~> 3.0'
# social logins

gem 'money-rails'
# add money feature

gem 'geocoder', '~> 1.3', '>= 1.3.7'
# for google maps / locations

gem 'rubocop', '~> 0.42.0'
# for code styling / errors

gem 'counter_culture', '~> 0.1.33'
# for counting bookings and quantity




# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use Unicorn as the app server
# gem 'unicorn'

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

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

group :development do
  # Access an IRB console on exception pages or by using <%= console %> in views
  gem 'web-console', '~> 2.0'

  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring'
end

我的 Gemfile.lock 文件包含以前更新的版本。我看到关于是否简单地删除此文件的混合消息,因为如果我删除它,它似乎只会打开其他蠕虫罐。我应该简单地删除 gemfile 上对“版本”的任何引用吗?感谢您提供任何帮助。

【问题讨论】:

  • 能否请您复制+粘贴文本而不是在此处嵌入图像?它使帖子更易于阅读。
  • 在使用这样的屏幕颜色后,您还能看到吗?就像我的意思一样,你没有失去视力吗?看图片超过零秒是不可能的。照顾好你的眼睛:)
  • 您的 cmets 已被记录。我最近在弄乱颜色,还没来得及改回来。当我解决这个问题时,我会这样做。有什么想法吗?
  • 不需要删除gemfile.lock;如果您执行bundle update 命令;它将尝试从 gemfile 安装。
  • 只是阅读错误信息,sass-rails 显然是拦截器。当您尝试更新它时会发生什么?

标签: ruby-on-rails ruby rubygems ruby-on-rails-5


【解决方案1】:

只要运行:

bundle update

它会更新你的 Gemfile.lock

【讨论】:

    【解决方案2】:

    完全删除 Gemfile.lock 并再次运行 bundle install 怎么样 ;) 哈哈

    【讨论】:

      猜你喜欢
      • 2015-02-16
      • 1970-01-01
      • 2021-07-09
      • 1970-01-01
      • 2019-03-02
      • 2018-05-19
      • 1970-01-01
      • 2012-05-05
      相关资源
      最近更新 更多