2010-10-31 83 views
0

我以前使用Ruby 1.8.7 & Rails 2.3.5 on Heroku试图在Heroku上从Rails 2.3.5升级到3.0.1,但Heroku仍然认为我正在使用2.3.5

我使用说明this railscast将我的开发环境升级到Ruby 1.9.2和Rails 3.0.1。使用RVM,所以Ruby和Rails的系统版本分别仍然是1.8.7 & Rails 2.3.5,但是我有一个RVM环境,我现在使用的是1.9.2和3.0.1。

我现在正在尝试使用Heroku上的新版本。我将我的Heroku stack转换为bamboo-mri-1.9.2并且做了git push heroku master。这似乎工作:

-----> Heroku receiving push 
-----> Migrating from bamboo-ree-1.8.7 to bamboo-mri-1.9.2 

-----> Rails app detected 
-----> Detected Rails is not set to serve static_assets 
     Installing rails3_serve_static_assets... done 
-----> Gemfile detected, running Bundler version 1.0.0 
     Unresolved dependencies detected; Installing... 
     Fetching source index for http://rubygems.org/ 

     (gems installing here) 

     Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed. 

     Your bundle was installed to `.bundle/gems` 
     Compiled slug size is 5.9MB 
-----> Launching.... done 
     http://www.(website url).com deployed to Heroku 

-----> Migration complete, your app is now running on bamboo-mri-1.9.2 

但后来我试图做heroku rake db:migrate和得到这个错误:

Missing the Rails 2.3.5 gem. Please `gem install -v=2.3.5 rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed. 
(in /disk1/home/slugs/233596_aed03bf_79e9-a5a7f70e-7120-4f42-ad2a-162b4a1974d6/mnt) 

出于某种原因,仍然认为它是on Rails的2.3.5运行。什么导致了这个问题?谢谢阅读。

的Gemfile

gem "rails", "3.0.1" 

的.gitignore:

.bundle 
log/*.log 
tmp/* 
tmp/**/* 
doc/api 
doc/app 
db/*.sqlite3 
*.swp 
*~ 
.DS_Store 

到config/environment.rb

# Load the rails application 
require File.expand_path('../application', __FILE__) 

# Initialize the rails application 
Liferecord::Application.initialize! 

配置/环境/ production.rb

my_app::Application.configure do 
    # Settings specified here will take precedence over those in config/environment.rb 

    # The production environment is meant for finished, "live" apps. 
    # Code is not reloaded between requests 
    config.cache_classes = true 

    # Full error reports are disabled and caching is turned on 
    config.consider_all_requests_local  = false 
    config.action_controller.perform_caching = true 

    # Specifies the header that your server uses for sending files 
    config.action_dispatch.x_sendfile_header = "X-Sendfile" 

    # For nginx: 
    # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' 

    # If you have no front-end server that supports something like X-Sendfile, 
    # just comment this out and Rails will serve the files 

    # See everything in the log (default is :info) 
    # config.log_level = :debug 

    # Use a different logger for distributed setups 
    # config.logger = SyslogLogger.new 

    # Use a different cache store in production 
    # config.cache_store = :mem_cache_store 

    # Disable Rails's static asset server 
    # In production, Apache or nginx will already do this 
    config.serve_static_assets = false 

    # Enable serving of images, stylesheets, and javascripts from an asset server 
    # config.action_controller.asset_host = "http://assets.example.com" 

    # Disable delivery errors, bad email addresses will be ignored 
    # config.action_mailer.raise_delivery_errors = false 


    # Enable threaded mode 
    # config.threadsafe! 

    # Enable locale fallbacks for I18n (makes lookups for any locale fall back to 
    # the I18n.default_locale when a translation can not be found) 
    config.i18n.fallbacks = true 

    # Send deprecation notices to registered listeners 
    config.active_support.deprecation = :notify 
end 

编辑:

$ heroku info 
=== (heroku name) 
Web URL:  (my url) 
Domain name: (my domain) 
Git Repo:  [email protected]:(heroku name).git 
Dynos:   1 
Workers:  0 
Repo size:  10M 
Slug size:  388k 
Stack:   bamboo-mri-1.9.2 
Data size:  416k in 9 tables 
Addons:   Custom Domains 
Owner:   (my email) 

回答

1

我认为你需要更改堆栈本地计算机指向。

> heroku info 

告诉你在你的终端?

也许这有助于http://docs.heroku.com/renaming-apps#manually-updating-a-git-remote

+0

我已经在问题中粘贴了heroku信息输出。感谢您的帮助 – ben 2010-10-31 21:16:23

+0

嗯......我不确定有什么问题。也许你可以做一个小修改,承诺并尝试再次推送。也许使用'git add -A'? – monocle 2010-11-01 00:29:20

+0

非常感谢,只需要再次提交即可。奇怪的。谢谢你的帮助! – ben 2010-11-01 06:50:00