2012-01-04 55 views
2

我對rails比較陌生,一直在邁克爾·哈特爾教程中工作。在整個過程中,我一直在將我的項目部署到Heroku,但現在我在第5章結束時,出現了「應用程序錯誤」。具體來說,我正在以下錯誤,當我看着我的Heroku的日誌:部署到Rails項目到Heroku:找不到activemodel

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 

謝謝!

回答

1

現在可以使用新的導軌的實時版本...我認爲你應該嘗試導軌3.1.3成熟的版本......這似乎是配置問題,因爲我正在使用rails 3.1完美運行我的應用程序。 3在heroku。

+0

降級似乎工作的偉大,然後我跑進約藍圖的CSS問題,並找到了答案,這個問題在這裏:[鏈接](http://stackoverflow.com/questions/7300532/blueprint-css- rails-3-1-help)感謝您的幫助! – 2012-01-08 15:58:43

1

您的Gemfile.lock文件是否提到此版本的ActiveModel?你做了一個完整的bundle update rails/bundle install,然後提交文件並重新部署?

0

我有同樣的問題。當我部署到Heroku時,本地開發工作的部分工作不起作用。很有可能你的Gem被鎖定到老版本的Rails(或者像我的情況那樣是ActiveSupport)。查看你的Gemfile.lock文件。您可能會找到對舊版Rails組件的引用。

如果您認爲這是真的,請嘗試註釋gem並查看部署到Heroku時您的應用是否會運行。如果是這樣,那麼請查看GitHub發佈的有問題的gem分支,看看是否有人有解決方案。如果您找到替代方案,請在您的gem文件中指定git存儲庫,然後運行bundle install。

例如

gem 'tinymce-rails', :git => 'git://github.com/spohlenz/tinymce-rails.git'