我在 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
时,找不到 railties。
我尝试gem install railties
在 Heroku 上使用 bash 手动安装它,但无法解决问题。
我在我的 Gemfile 中添加了 railties(尽管它应该自动依赖),但没有帮助。
提前致谢。