[英]NameError: uninitialized constant Bundler
我剛剛將我的網絡服務器更改為 Puma,並且不得不將我的開發數據庫從 sqlite 更改為 postgresql。 但現在我每次嘗試運行“rake db:migrate”時都會收到此錯誤:
rake aborted!
NameError: uninitialized constant Bundler
C:/Sites/dawnrebirth/config/application.rb:7:in <top (required)>'
C:/Sites/dawnrebirth/Rakefile:4:in <top (required)>'
(See full trace by running task with --trace)
我的寶石文件:
source 'https://rubygems.org'
gem 'rails', '4.2.1'
gem 'pg'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
group :development, :test do
gem 'byebug'
gem 'web-console', '~> 2.0'
gem 'better_errors', '~> 2.1.1'
gem 'annotate', '~> 2.6.10'
gem 'binding_of_caller'
end
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem 'devise', '~> 3.5.1'
gem 'haml', '~> 4.0.6'
gem 'sass', '~> 3.4.14'
gem 'paperclip', '~> 4.3.0'
gem 'babosa', '~> 1.0.2'
gem 'rails-i18n', '~> 4.0.4'
gem 'devise-i18n', '~> 0.12.1'
gem 'simple_form', '~> 3.1.0'
gem 'dotiw'
gem 'paperclip-dropbox', '~> 1.3.2'
gem 'rmagick', '~> 2.15.3', group: :production
gem 'masonry-rails', '~> 0.2.4'
gem 'rufus-scheduler', '~> 3.1.3'
gem 'jquery-turbolinks'
gem 'puma'
gem 'rails_12factor', group: :production
gem 'mailboxer'
gem 'acts_as_votable'
ruby "2.1.5"
編輯:
運行bundle exec rake db:migrate
工作並成功遷移我的數據庫。
安裝bundler
gem:
gem install bundler
然后,再試一次。
如果上述方法不起作用,請嘗試:
rm -rf .bundle/
rm -rf vendor/cache/
然后再試一次。
如果這不起作用,您可以嘗試刪除不推薦的Gemfile.lock
(但如果您剛剛開始您的項目並且沒有其他人在他們的機器中擁有Gemfile.lock
,您可以這樣做):
rm -rf Gemfile.lock
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.