【问题标题】:Cannot run a migration update in Ruby无法在 Ruby 中运行迁移更新
【发布时间】:2015-10-18 21:01:57
【问题描述】:

我正在使用 ruby​​,我去执行 rake db:migrate,但出现以下错误:

LoadError: 无法加载此类文件 -- bundler/setup C:/Sites/raddit/config/boot.rb:4:in <top (required)>' C:/Sites/raddit/config/application.rb:1:in' C:/Sites/raddit/Rakefile:4:in `

然后我运行 bundle exec rake db:migrate 并得到这个错误

您已要求: sqlite3 >= 0

当前捆绑包的 sqlite3 锁定在 1.3.11。 尝试运行bundle update sqlite3

我按照它的说法更新了 sqlite 3,并删除了我的 gemfile,但没有任何效果

这是我的 Gemfile

  source 'https://rubygems.org'

gem 'devise', '~> 3.5', '>= 3.5.2'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.8'
# Use sqlite3 as the database for Active Record
gem 'sqlite3', '~> 1.3', '>= 1.3.11'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.3'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/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



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

【问题讨论】:

  • 您是否尝试删除 gem.lock 文件并再次运行捆绑安装?
  • 你能告诉我们你的 Gemfile 是什么样的吗?
  • 添加了我的 gemfile,是的,Amir 我什至在我最初的问题中说过。

标签: ruby-on-rails ruby sqlite dbmigrate


【解决方案1】:

为了解决这个问题,我刚刚重新安装了 bundler 来执行此操作,只需执行 gem install bundler,然后运行 ​​bundle install。它将重新安装所有过去的 gem,并应该解决问题。

【讨论】:

    猜你喜欢
    • 2017-02-07
    • 2017-05-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-09-16
    • 1970-01-01
    • 1970-01-01
    • 2016-08-11
    相关资源
    最近更新 更多