Heroku控制台抛出'railties'的依赖错误

时间:2013-06-21 21:53:03

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

我在Cedar上使用Rails 4.0.0.beta1和Ruby 1.9.3,我无法访问我的生产Rails控制台。 Stack Overflow上此错误的所有解决方案都是本地开发环境的解决方案,而不是Heroku。

heroku run console --app myapp

使用Ruby 1.9.3时,错误是:

Running `console` attached to terminal... up, run.2461
/app/vendor/ruby-1.9.3/lib/ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find railties (>= 0) amongst [activerecord-deprecated_finders-0.0.3, annotate-2.5.0, arel-4.0.0, atomic-1.1.9, aws-sdk-1.11.1, bcrypt-ruby-3.0.1, bigdecimal-1.1.0, builder-3.1.4, bundler-1.3.2, coffee-rails-4.0.0, coffee-script-2.2.0, coffee-script-source-1.6.2, curb-0.8.4, dotenv-0.8.0, eco-1.0.0, eco-source-1.1.0.rc.1, ejs-1.0.0, erubis-2.7.0, execjs-1.4.0, foreman-0.63.0, hike-1.2.3, i18n-0.6.4, io-console-0.3, jquery-rails-3.0.1, json-1.8.0, json-1.5.5, kgio-2.8.0, mail-2.5.4, messengerjs-rails-1.3.3, mime-types-1.23, mini_portile-0.5.0, minitest-4.7.4, minitest-2.5.1, multi_json-1.7.7, nokogiri-1.6.0, orm_adapter-0.4.0, pg-0.15.1, polyglot-0.3.3, protected_attributes-1.0.1, rack-1.5.2, rack-test-0.6.2, rails-backbone-0.7.2, rails_12factor-0.0.2, rails_on_heroku-0.0.2, rails_serve_static_assets-0.0.1, rails_stdout_logging-0.0.1, raindrops-0.11.0, rake-10.1.0, rake-0.9.2.2, rdoc-3.12.2, rdoc-3.9.5, sass-3.2.9, sass-rails-4.0.0.rc2, sprockets-2.10.0, sprockets-rails-2.0.0, thor-0.18.1, thread_safe-0.1.0, tilt-1.4.1, treetop-1.4.14, tzinfo-0.3.37, uglifier-2.1.1, unicorn-4.6.3, uuidtools-2.1.4, valid_email-0.0.4, warden-1.2.1] (Gem::LoadError)
    from /app/vendor/ruby-1.9.3/lib/ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
    from /app/vendor/ruby-1.9.3/lib/ruby/1.9.1/rubygems.rb:1231:in `gem'
    from bin/rails:22:in `<main>'

使用Ruby 2.0.0时,错误是:

Running `console` attached to terminal... up, run.1088
/app/vendor/ruby-2.0.0/lib/ruby/site_ruby/2.0.0/rubygems/dependency.rb:296:in `to_specs': Could not find 'railties' (>= 0) among 67 total gem(s) (Gem::LoadError)
    from /app/vendor/ruby-2.0.0/lib/ruby/site_ruby/2.0.0/rubygems/dependency.rb:307:in `to_spec'
    from /app/vendor/ruby-2.0.0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_gem.rb:47:in `gem'
    from bin/rails:22:in `<main>'

当我进入Heroku bash shell并发出gem list时,找不到铁路。

我尝试在Heroku的bash中使用gem install railties手动安装它,安装它但不解决问题。

我已经在我的Gemfile中添加了栏目(虽然它应该自动依赖)但这没有帮助。

提前致谢。

1 个答案:

答案 0 :(得分:0)

我通过在本地运行bundle install --binstubs,将文件添加到我的git存储库并重新推送到Heroku来解决这个问题。