【问题标题】:Could not find activemodel-3.2.0 in any of the sources (Rails 3.2 on Heroku)在任何来源中都找不到 activemodel-3.2.0(Heroku 上的 Rails 3.2)
【发布时间】:2012-02-26 12:56:47
【问题描述】:

我是 Rails 和 Heroku 的新手,但我有一个非常简单的应用程序在本地运行。

我以为我会尝试在 Heroku 上运行,但可惜我一直遇到同样的问题。

Could not find activemodel-3.2.0 in any of the sources

Stack Overflow 上有相关的问题,但他们的建议或答案似乎都没有为我解决这个问题。

其他试图回答这个问题的帖子要求 Gemfile,所以这是我的

source 'https://rubygems.org'

gem 'rails', '3.2.0'

group :development, :test do
  gem 'sqlite3'
end
group :production do
  gem 'pg'
end

group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'

  gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'

这是我的 Gemfile.lock

GEM


remote: https://rubygems.org/
  specs:
    actionmailer (3.2.0)
      actionpack (= 3.2.0)
      mail (~> 2.4.0)
    actionpack (3.2.0)
      activemodel (= 3.2.0)
      activesupport (= 3.2.0)
      builder (~> 3.0.0)
      erubis (~> 2.7.0)
      journey (~> 1.0.0)
      rack (~> 1.4.0)
      rack-cache (~> 1.1)
      rack-test (~> 0.6.1)
      sprockets (~> 2.1.2)
    activemodel (3.2.0)
      activesupport (= 3.2.0)
      builder (~> 3.0.0)
    activerecord (3.2.0)
      activemodel (= 3.2.0)
      activesupport (= 3.2.0)
      arel (~> 3.0.0)
      tzinfo (~> 0.3.29)
    activeresource (3.2.0)
      activemodel (= 3.2.0)
      activesupport (= 3.2.0)
    activesupport (3.2.0)
      i18n (~> 0.6)
      multi_json (~> 1.0)
    arel (3.0.0)
    builder (3.0.0)
    coffee-rails (3.2.2)
      coffee-script (>= 2.2.0)
      railties (~> 3.2.0)
    coffee-script (2.2.0)
      coffee-script-source
      execjs
    coffee-script-source (1.2.0)
    erubis (2.7.0)
    execjs (1.3.0)
      multi_json (~> 1.0)
    hike (1.2.1)
    i18n (0.6.0)
    journey (1.0.1)
    jquery-rails (2.0.0)
      railties (>= 3.2.0.beta, < 5.0)
      thor (~> 0.14)
    json (1.6.5)
    mail (2.4.1)
      i18n (>= 0.4.0)
      mime-types (~> 1.16)
      treetop (~> 1.4.8)
    mime-types (1.17.2)
    multi_json (1.0.4)
    pg (0.12.2)
    polyglot (0.3.3)
    rack (1.4.1)
    rack-cache (1.1)
      rack (>= 0.4)
    rack-ssl (1.3.2)
      rack
    rack-test (0.6.1)
      rack (>= 1.0)
    rails (3.2.0)
      actionmailer (= 3.2.0)
      actionpack (= 3.2.0)
      activerecord (= 3.2.0)
      activeresource (= 3.2.0)
      activesupport (= 3.2.0)
      bundler (~> 1.0)
      railties (= 3.2.0)
    railties (3.2.0)
      actionpack (= 3.2.0)
      activesupport (= 3.2.0)
      rack-ssl (~> 1.3.2)
      rake (>= 0.8.7)
      rdoc (~> 3.4)
      thor (~> 0.14.6)
    rake (0.9.2.2)
    rdoc (3.12)
      json (~> 1.4)
    sass (3.1.12)
    sass-rails (3.2.4)
      railties (~> 3.2.0)
      sass (>= 3.1.10)
      tilt (~> 1.3)
    sprockets (2.1.2)
      hike (~> 1.2)
      rack (~> 1.0)
      tilt (~> 1.1, != 1.3.0)
    sqlite3 (1.3.5)
    thor (0.14.6)
    tilt (1.3.3)
    treetop (1.4.10)
      polyglot
      polyglot (>= 0.3.1)
    tzinfo (0.3.31)
    uglifier (1.2.3)
      execjs (>= 0.3.0)
      multi_json (>= 1.0.2)

PLATFORMS
  ruby

DEPENDENCIES
  coffee-rails (~> 3.2.1)
  jquery-rails
  pg
  rails (= 3.2.0)
  sass-rails (~> 3.2.3)
  sqlite3
  uglifier (>= 1.0.3)

这里有更多的heroku日志

2012-02-03T23:28:53+00:00 app[web.1]: WARNING:  Invalid .gemspec format in '/app/.bundle/gems/ruby/1.9.1/specifications/activeresource-3.2.0.gemspec'
2012-02-03T23:28:53+00:00 app[web.1]:     s.add_dependency(%q<activemodel>, ["#<Syck::DefaultKey:0x000000089d28c8> 3.2.0"])
2012-02-03T23:28:53+00:00 app[web.1]:   end
2012-02-03T23:28:53+00:00 app[web.1]: end
2012-02-03T23:28:53+00:00 app[web.1]:     s.add_dependency(%q<activesupport>, ["#<Syck::DefaultKey:0x000000089d3d40> 3.2.0"])
2012-02-03T23:28:53+00:00 app[web.1]:   else
2012-02-03T23:28:53+00:00 app[web.1]:       s.add_runtime_dependency(%q<activemodel>, ["#<Syck::DefaultKey:0x000000089d28c8> 3.2.0"])
2012-02-03T23:28:53+00:00 app[web.1]: Could not find activemodel-3.2.0 in any of the sources
2012-02-03T23:28:53+00:00 app[web.1]: !! Unexpected error while processing request: exit

heroku info --app &lt;my app&gt;的结果

=== <my app>
Addons:        Basic Logging, Shared Database 5MB
Database Size: (empty)
Dynos:         1
Git URL:       git@heroku.com:<my app>.git
Owner:         me@myemail.com
Repo Size:     7M
Slug Size:     6M
Stack:         bamboo-mri-1.9.2
Web URL:       http://<my app>.heroku.com/
Workers:       0

如果有人有任何好主意,那就太好了。如果你能用超级新手的术语来解释它们,那就更好了。谢谢。

【问题讨论】:

  • 请同时粘贴:你的Gemfile.lock,运行git status的结果(应该是干净的),你尝试推送的结果,以及heroku logs --app &lt;your app&gt;的输出。
  • 另外,heroku info --app &lt;your app&gt; 能得到什么?
  • 嗨,约翰,感谢您的回复。我在上面添加了我的 Gemfile.lock 和更多的 heroku 日志。 git status 返回# On branch master nothing to commit (working directory clean)' and git push heroku master` 返回Everything up-to-date
  • 还添加了上面heroku info --app &lt;your app&gt; 的结果。谢谢。

标签: ruby-on-rails ruby-on-rails-3 deployment heroku


【解决方案1】:

您正在 Bamboo 堆栈上运行该项目。 Heroku 建议您在 Cedar 堆栈上运行 Rails 3.2 应用程序,因为 Rails 3.2 需要某些更现代的 Rubygems 和 Ruby 版本才能正常运行。

如果您出于某种原因需要使用 Bamboo,您可以降级并改用 Rails 3.0.x 系列。

否则,您可以使用以下命令创建新的 Cedar 应用:

heroku create --stack cedar

在更新 heroku 遥控器后,像以前一样推送代码。

【讨论】:

  • 感谢约翰的帮助。这是一种享受。如果其他人像我一样不熟悉这一切,您可以通过手动编辑文件 .git/config 来更新您的 heroku 遥控器,尽管在终端中可能有一种方法。
  • 你可以用git remote rm heroku更新heroku远程,然后git remote add heroku ...
  • 将现有应用迁移到 cedar 堆栈的说明:devcenter.heroku.com/articles/cedar-migration
猜你喜欢
  • 1970-01-01
  • 2016-04-26
  • 2014-03-02
  • 2018-08-01
  • 2013-06-22
  • 1970-01-01
  • 1970-01-01
  • 2013-02-23
  • 2012-03-30
相关资源
最近更新 更多