我对rails非常陌生,并且一直在迈向Michael Hartl Tutorial。我一直在将我的项目部署到Heroku,但是现在我在第5章的末尾,我收到了“应用程序错误”。具体来说,当我查看我的Heroku日志时,我收到以下错误:
2012-01-04T03:05:04+00:00 app[web.1]: Could not find activemodel-3.2.0.rc1 in any of the sources
2012-01-04T03:05:06+00:00 heroku[web.1]: State changed from starting to crashed
2012-01-04T03:05:06+00:00 heroku[web.1]: Process exited
2012-01-04T03:05:11+00:00 heroku[router]: Error H10 (App crashed) -> GET floating-stone 5077.heroku.com/ dyno= queue= wait= service= status=503 bytes=
在日志的早期,我也看到了以下错误:
WARNING: Invalid .gemspec format in '/app/.bundle/gems/ruby/1.9.1/specifications/rails-3.2.0.rc1.gemspec'
WARNING: Invalid .gemspec format in '/app/.bundle/gems/ruby/1.9.1/specifications/actionmailer-3.2.0.rc1.gemspec'
WARNING: Invalid .gemspec format in '/app/.bundle/gems/ruby/1.9.1/specifications/actionpack-3.2.0.rc1.gemspec'
我的gemfile如下:
source 'https://rubygems.org'
gem 'rails', '3.2.0.rc1'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'mysql2'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.0'
gem 'coffee-rails', '~> 3.2.0'
#gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
group :development do
gem 'rspec-rails', '2.7.0'
gem 'ZenTest', '4.6.2'
gem 'autotest-growl'
gem 'autotest-fsevent'
gem 'webrat', '0.7.3'
end
group :test do
gem 'rspec', '2.7.0'
gem 'webrat', '0.7.3'
end
我在调试问题时遇到了问题,并查看了我能找到的几乎所有rails / heroku帖子,但在这个具体问题上没有任何内容。我正在寻求一些帮助...如果这是非常基本的话,我会道歉。
我还应该提一下,应用程序在我的本地机器上工作正常,这是我的数据库信息(我使用的是mysql)。这是数据库信息。
# MySQL. Versions 4.1 and 5.0 are recommended.
#
# Install the MYSQL driver
# gem install mysql2
#
# Ensure the MySQL gem is defined in your Gemfile
# gem 'mysql2'
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
adapter: mysql2
encoding: utf8
reconnect: false
database: sample_app_development
pool: 5
username: root
password:
socket: /tmp/mysql.sock
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
adapter: mysql2
encoding: utf8
reconnect: false
database: sample_app_test
pool: 5
username: root
password:
socket: /tmp/mysql.sock
production:
adapter: mysql2
encoding: utf8
reconnect: false
database: sample_app_production
pool: 5
username: root
password:
socket: /tmp/mysql.sock
谢谢!
答案 0 :(得分:2)
现在可以使用新版本的实时版本...我认为你应该尝试使用rails 3.1.3成熟版本...这似乎是配置问题,因为我正在使用rails 3.1.3完美运行我的应用程序在heroku。
答案 1 :(得分:1)
你的Gemfile.lock文件是否提到了这个版本的ActiveModel?您是否完成了bundle update rails
/ bundle install
,然后提交了文件并重新部署了?
答案 2 :(得分:0)
我有同样的问题。我在本地开发的工作,在我部署到Heroku时不起作用。很可能你有一个gem被锁定到旧版本的Rails(或者我的情况下是ActiveSupport)。查看你的Gemfile.lock文件。您可能会找到对旧版Rails组件的引用。
如果您发现这是真的,请尝试注释掉gem并查看您的应用是否会在部署到Heroku时运行。如果是这样,那么请查看有问题的宝石的GitHub分叉,看看是否有人有解决方案。如果找到替代方法,请在gem文件中指定git存储库,然后运行bundle install。
e.g。
gem 'tinymce-rails', :git => 'git://github.com/spohlenz/tinymce-rails.git'