推送到 Heroku 时 Rake 中止错误 (factory_girl)

发布于 2024-12-29 07:26:09 字数 1231 浏览 0 评论 0原文

尝试推送到 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

瑾夏年华 2025-01-05 07:26:09

有些东西仍在尝试加载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.)

花海 2025-01-05 07:26:09

检查您的

.slugignore

spec/test/ 目录经常被忽略。

Check your

.slugignore

spec/ and test/ directories are often ignored.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文