【问题标题】:Trying to upgrade from Rails 2.3.5 to 3.0.1 on Heroku, but Heroku still thinks I'm using 2.3.5尝试在 Heroku 上从 Rails 2.3.5 升级到 3.0.1,但 Heroku 仍然认为我使用的是 2.3.5
【发布时间】:2010-10-31 06:50:31
【问题描述】:

我之前在 Heroku 上使用 Ruby 1.8.7 和 Rails 2.3.5。

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

我现在正在尝试让新版本在 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)

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

宝石文件

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

编辑:

$ 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)

【问题讨论】:

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


    【解决方案1】:

    我认为您需要更改本地计算机指向的堆栈。是什么

    > heroku info
    

    在你的终端告诉你?

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

    【讨论】:

    • 我已将 heroku 信息输出粘贴到问题中。感谢您的帮助
    • 嗯...我不确定出了什么问题。也许你可以做一个小的修改,提交并再次尝试推送。也许使用 'git add -A .'?
    • 谢谢,只需要运行另一个提交。奇怪的。感谢您的帮助!
    猜你喜欢
    • 2023-03-13
    • 2012-10-07
    • 1970-01-01
    • 1970-01-01
    • 2021-04-05
    • 2021-03-08
    • 1970-01-01
    • 1970-01-01
    • 2017-06-10
    相关资源
    最近更新 更多