我新的轨道,所以请随时提出任何可能帮助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