推送到 Heroku 时 Rake 中止错误 (factory_girl)
尝试推送到 Heroku 时出现此错误:
heroku run rake db:migrate 运行 rake db:migrate 连接到终端... up, run.1 耙子中止! 没有要加载的文件 --factory_girl
这是我的 Gemfile:
source 'http://rubygems.org'
gem 'rails', '3.1.1'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'gravatar_image_tag', '0.1.0'
gem 'will_paginate', '~> 3.0.2'
group :production do
gem 'pg'
end
group :development do
gem 'rspec-rails'
gem 'sqlite3'
gem 'annotate',
:git => 'git://github.com/jeremyolliver/annotate_models.git',
:branch => 'rake_compatibility'
end
group :test do
gem 'rspec'
gem 'webrat'
gem 'spork'
gem 'factory_girl'
gem 'factory_girl_rails'
end
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.1.4'
gem 'coffee-rails', '~> 3.1.1'
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# Use unicorn as the web server
# gem 'unicorn'
# Deploy with Capistrano
gem 'capistrano'
# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'
I am getting this error when trying to push to Heroku:
heroku run rake db:migrate
Running rake db:migrate attached to terminal... up, run.1
rake aborted!
no such file to load -- factory_girl
Here is my Gemfile:
source 'http://rubygems.org'
gem 'rails', '3.1.1'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'gravatar_image_tag', '0.1.0'
gem 'will_paginate', '~> 3.0.2'
group :production do
gem 'pg'
end
group :development do
gem 'rspec-rails'
gem 'sqlite3'
gem 'annotate',
:git => 'git://github.com/jeremyolliver/annotate_models.git',
:branch => 'rake_compatibility'
end
group :test do
gem 'rspec'
gem 'webrat'
gem 'spork'
gem 'factory_girl'
gem 'factory_girl_rails'
end
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.1.4'
gem 'coffee-rails', '~> 3.1.1'
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# Use unicorn as the web server
# gem 'unicorn'
# Deploy with Capistrano
gem 'capistrano'
# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
有些东西仍在尝试加载factory_girl,所以我尝试运行 rake db:migrate --trace 以查看是否提供任何有用的信息。
更重要的是,您的规格是否已编译到您的 slug 中?如果是这样,请尝试将规范目录包含在 .slugignore 中。 (基本上我猜测一些意想不到的副作用是引用 f_g ,这对我来说可能是罪魁祸首。)
Something is still trying to load factory_girl, so I'd try running rake db:migrate --trace to see if that provides any helpful info.
Even more to the point, are your specs being compiled into your slug? If so, try including the spec dir in .slugignore. (Basically I'm guessing some unintended side effect is referencing f_g and that seems a likely culprit to me.)
检查您的
spec/
和test/
目录经常被忽略。Check your
spec/
andtest/
directories are often ignored.