Trying to upgrade from Rails 2.3.5 to 3.0.1 on Heroku, but Heroku still thinks I'm using 2.3.5
I was previously using Ruby 1.8.7 & Rails 2.3.5 on Heroku.
I upgraded my development environment to Ruby 1.9.2 and Rails 3.0.1 using the instructions this railscast. RVM is used, so the system versions of Ruby and Rails are still 1.8.7 & Rails 2.3.5 respectively, but I have an RVM environment with 1.9.2 and 3.0.1, which I now use.
I'm now trying to get the new versions working on Heroku. I switched my Heroku stack to bamboo-mri-1.9.2 and did git push heroku master
. That seemed to work:
-----> 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
But then I tried to do heroku rake db:migrate
and got this error:
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)
For some reason开发者_如何学运维 it still thinks it's running on Rails 2.3.5. What is causing this problem? Thanks for reading.
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!
config/environments/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
EDIT:
$ heroku info
=== (heroku name)
Web URL: (my url)
Domain name: (my domain)
Git Repo: git@heroku.com:(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)
I think you need to change which stack your local machine is pointing to. What does
> heroku info
tell you in your terminal?
Maybe this helps http://docs.heroku.com/renaming-apps#manually-updating-a-git-remote.
精彩评论