我新的軌道,所以請隨時提出任何可能幫助rake db:遷移錯誤。詢問tzinfo-1.2.1
的Gemfile如下
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 'rails', '~> 5.1.4'
gem 'mysql2', '0.4.9'
gem 'puma', '~> 3.7'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'bootstrap-sass'
gem 'devise'
gem 'coffee-rails', '~> 4.2'
gem 'turbolinks', '~> 5'
gem 'jbuilder', '~> 2.5'
gem 'bcrypt', '~> 3.1.7'
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw]
gem 'tzinfo', '1.2.1'
group :development, :test do
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
end
group :development do
gem 'web-console', '>= 3.3.0'
gem 'listen', '>= 3.0.5', '< 3.2'
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
end
當我在終端上運行sudo rake db:migrate
[對於一些因此,我需要須藤每次我運行rake命令的時間],我得到
Could not find tzinfo-1.2.1 in any of the sources Run
bundle install
to install missing gems.
我曾試圖消除Gemfile.lock的運行捆綁重新安裝,但它並沒有幫助。我搜索了一下,發現沒有幫助。
當我跑bundle info tzinfo
,它沒有給我一個位置
* tzinfo (1.2.1)
Summary: Daylight savings aware timezone library
Homepage: http://tzinfo.github.io
Path: /home/t430/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/tzinfo-1.2.1
我嘗試了所有的建議的事情作爲this question,但它並沒有幫助
的Ubuntu 16.04
你真的需要'須藤rake'?你有沒有嘗試sudo? – lcguida
使用sudo時你有不同的環境,你的gempath可能會有所不同或未設置。你不應該使用sudo來進行rake工作,你從'rake db:migrate'沒有sudo會得到什麼錯誤? –
@JacobVanus當我嘗試沒有sudo時,我得到這個 rake中止! Mysql2 ::錯誤:拒絕訪問用戶'root'@'localhost'(使用密碼:否) 任務:TOP => db:migrate (使用--trace查看完整跟蹤) – nonejk