0

我的 ror 应用程序在 rails 2.3.5(需要机架 1.0.1)上运行,heroku 上的 Thin 默认激活机架 1.1.0

并抛出错误:

    " You have already activated rack 1.1.0, but your Gemfile requires rack 1.0.1. Consider using bundle exec."

    my Gemfile:

source 'http://rubygems.org'


group :test, :development do
  gem "rack","1.0.1"
end

gem "rails","2.3.5"
gem "mysql"
gem "rake", "0.8.3"
gem "declarative_authorization", "0.5.2"
gem "searchlogic"
gem "prawn", "0.6.3"
gem "thin","1.2.11"

group :test, :development do
  gem "rack","1.0.1"
end


group :development do
  # bundler requires these gems in development
  # gem "rails-footnotes"
end

group :test do
  # bundler requires these gems while running tests
  # gem "rspec"
  # gem "faker"
end
----------------------

我安装了 bundler 并开发了 Gemfile.lock :

    GEM
      remote: http://rubygems.org/
      specs:
        actionmailer (2.3.5)

          actionpack (= 2.3.5)
        actionpack (2.3.5)
          activesupport (= 2.3.5)
          rack (~> 1.0.0)
        activerecord (2.3.5)
          activesupport (= 2.3.5)
        activeresource (2.3.5)
          activesupport (= 2.3.5)
        activesupport (2.3.5)
        daemons (1.1.4)
        declarative_authorization (0.5.2)
        eventmachine (0.12.10)
        mysql (2.8.1)
        prawn (0.6.3)
          prawn-core (>= 0.6.3, < 0.7)
          prawn-format (>= 0.2.3, < 0.3)
          prawn-layout (>= 0.3.2, < 0.4)
          prawn-security (>= 0.1.1, < 0.2)
        prawn-core (0.6.3)
        prawn-format (0.2.3)
          prawn-core
        prawn-layout (0.3.2)
        prawn-security (0.1.1)
        rack (1.0.1)
        rails (2.3.5)
          actionmailer (= 2.3.5)
          actionpack (= 2.3.5)
          activerecord (= 2.3.5)
          activeresource (= 2.3.5)
          activesupport (= 2.3.5)
          rake (>= 0.8.3)
        rake (0.8.3)
        searchlogic (2.4.28)
          activerecord (>= 2.0.0)
        thin (1.2.11)
          daemons (>= 1.0.9)
          eventmachine (>= 0.12.6)
          rack (>= 1.0.0)

    PLATFORMS
      ruby

    DEPENDENCIES
      declarative_authorization (= 0.5.2)
      mysql
      prawn (= 0.6.3)
      rack (= 1.0.1)
      rails (= 2.3.5)
      rake (= 0.8.3)
      searchlogic
      thin (= 1.2.11)
    ---------------------------

请帮我在heroku上部署它......

4

1 回答 1

0

解决了...

我的应用程序使用 rack 1.0.1 , rails 2.3.5

Heroku 默认激活 rake 1.1.0..

所以我将我的 rails 应用程序版本切换到 2.3.11,它在 environment.rb 中使用机架 1.1.2 并创建了一个 Gem 文件,安装了捆绑程序

在我的笔记本电脑上测试...

生成锁定文件并将其推送到heroku ...

终于成功了……

花了一周时间让我的应用程序正常工作......

:)

于 2011-07-14T15:17:54.660 回答