为什么我为Rails :: Application :: Configuration获取未定义的方法active_record?

时间:2013-12-02 22:25:25

标签: ruby-on-rails heroku

当我尝试部署时,我在heroku日志中收到此错误:

2013-12-02T22:09:12.276590+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 40810 -e $RAILS_ENV`
2013-12-02T22:09:17.541445+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.1.rc1/lib/rails/railtie/configuration.rb:95:in `method_missing': undefined method `active_record' for #<Rails::Application::Configuration:0x007f307be78120> (NoMethodError)
2013-12-02T22:09:17.541445+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.1.rc1/lib/rails/commands.rb:71:in `tap'
2013-12-02T22:09:17.541445+00:00 app[web.1]:    from /app/config/application.rb:12:in `<top (required)>'
2013-12-02T22:09:17.541445+00:00 app[web.1]:    from /app/config/application.rb:54:in `<class:Application>'
2013-12-02T22:09:17.541445+00:00 app[web.1]:    from /app/config/application.rb:13:in `<module:SquashSimulator>'
2013-12-02T22:09:17.541445+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.1.rc1/lib/rails/commands.rb:74:in `block in <top (required)>'
2013-12-02T22:09:17.541445+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.1.rc1/lib/rails/commands.rb:74:in `require'
2013-12-02T22:09:17.541445+00:00 app[web.1]:    from bin/rails:4:in `<main>'
2013-12-02T22:09:17.541445+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.1.rc1/lib/rails/commands.rb:71:in `<top (required)>'
2013-12-02T22:09:17.541445+00:00 app[web.1]:    from bin/rails:4:in `require'
2013-12-02T22:09:19.271123+00:00 heroku[web.1]: State changed from starting to crashed
2013-12-02T22:09:19.258499+00:00 heroku[web.1]: Process exited with status 1

所以我不知道为什么Heroku不认为我有“Active Record”而且我不知道为什么应用程序崩溃......

有关如何解决的任何想法/建议?

当我尝试在本地运行它(并运行'rails server')时,我得到了这个:

(in /Users/ME/.rvm/gems/ruby-2.0.0-p247/gems/rails-0.9.5)
rake aborted!
ERROR: 'rake/rdoctask' is obsolete and no longer supported. Use 'rdoc/task' (available in RDoc 2.4.2+) instead.
/Users/ME/.rvm/gems/ruby-2.0.0-p247/gems/rails-0.9.5/Rakefile:3:in `<top (required)>'
(See full trace by running task with --trace)

我不知道如何实施他们推荐的修复程序......

@Mike,

这是我的宝石文件:

  1 source 'https://rubygems.org'
  2 ruby "2.0.0"
  3 gem 'rails'
  4 gem 'pg'
  5 gem 'jquery-rails'
  6 gem 'haml'
  7 gem 'bcrypt-ruby', '~>3.0.0'
  8 gem 'nokogiri'
  9 gem 'protected_attributes'
 10 gem 'sass-rails'
 11 gem 'coffee-rails'
 12 gem 'uglifier'
 13 gem 'rails_12factor'
 14
 15 group :development, :test do
 16   gem 'pry-rails'
 17   gem 'pry-debugger'
 18   gem 'pry-stack_explorer'
 19   gem 'annotate'
 20   gem 'quiet_assets'
 21   gem 'better_errors'
 22   gem 'binding_of_caller'
 23   gem 'meta_request'
 24 end

我的gemfile.lock:

  1 GEM
  2   remote: https://rubygems.org/
  3   specs:
  4     actionmailer (0.6.1)
  5       actionpack (>= 0.9.5)
  6     actionpack (4.0.1.rc1)
  7       activesupport (= 4.0.1.rc1)
  8       builder (~> 3.1.0)
  9       erubis (~> 2.7.0)
 10       rack (~> 1.5.2)
 11       rack-test (~> 0.6.2)
 12     activemodel (4.0.1.rc1)
 13       activesupport (= 4.0.1.rc1)
 14       builder (~> 3.1.0)
 15     activerecord (1.6.0)
 16     activesupport (4.0.1.rc1)
 17       i18n (~> 0.6, >= 0.6.4)
 18       minitest (~> 4.2)
 19       multi_json (~> 1.3)
 20       thread_safe (~> 0.1)
 21       tzinfo (~> 0.3.37)
 22     annotate (2.5.0)
 23       rake
 24     atomic (1.1.14)
 25     bcrypt-ruby (3.0.1)
 26     better_errors (1.0.1)
 27       coderay (>= 1.0.0)
 28       erubis (>= 2.6.6)
 29     binding_of_caller (0.7.2)
 30       debug_inspector (>= 0.0.1)
 31     builder (3.1.4)
 32     callsite (0.0.11)
 33     coderay (1.0.9)
 34     coffee-rails (4.0.0)
 35       coffee-script (>= 2.2.0)
 36       railties (>= 4.0.0.beta, < 5.0)
 37     coffee-script (2.2.0)
 38       coffee-script-source
 39       execjs
 40     coffee-script-source (1.6.3)
 41     columnize (0.3.6)
 42     debug_inspector (0.0.2)
 43     debugger (1.6.2)
 44       columnize (>= 0.3.1)
 45       debugger-linecache (~> 1.2.0)
 46       debugger-ruby_core_source (~> 1.2.3)
 47     debugger-linecache (1.2.0)
 48     debugger-ruby_core_source (1.2.3)
 49     erubis (2.7.0)
 50     execjs (2.0.2)
 51     haml (4.0.3)
 52       tilt
 53     hike (1.2.3)
 54     i18n (0.6.5)
 55     jquery-rails (3.0.4)
 56       railties (>= 3.0, < 5.0)
 57       thor (>= 0.14, < 2.0)
 58     meta_request (0.2.8)
 59       callsite
 60       rack-contrib
 61       railties
 62     method_source (0.8.2)
 63     mini_portile (0.5.1)
 64     minitest (4.7.5)
 65     multi_json (1.8.2)
 66     nokogiri (1.6.0)
 67       mini_portile (~> 0.5.0)
 68     pg (0.17.0)
 69     protected_attributes (1.0.4)
 70       activemodel (>= 4.0.1.rc1, < 5.0)
 71     pry (0.9.12.2)
 72       coderay (~> 1.0.5)
 73       method_source (~> 0.8)
 74       slop (~> 3.4)
 75     pry-debugger (0.2.2)
 76       debugger (~> 1.3)
 77       pry (~> 0.9.10)
 78     pry-rails (0.3.2)
 79       pry (>= 0.9.10)
 80     pry-stack_explorer (0.4.9.1)
 81       binding_of_caller (>= 0.7)
 82       pry (>= 0.9.11)
 83     quiet_assets (1.0.2)
 84       railties (>= 3.1, < 5.0)
 85     rack (1.5.2)
 86     rack-contrib (1.1.0)
 87       rack (>= 0.9.1)
 88     rack-test (0.6.2)
 89       rack (>= 1.0)
 90     rails (0.9.5)
 91       actionmailer (>= 0.6.1)
 92       actionpack (>= 1.4.0)
 93       activerecord (>= 1.6.0)
 94       rake (>= 0.4.15)
 95     rails_12factor (0.0.2)
 96       rails_serve_static_assets
 97       rails_stdout_logging
 98     rails_serve_static_assets (0.0.1)
 99     rails_stdout_logging (0.0.3)
100     railties (4.0.1.rc1)
101       actionpack (= 4.0.1.rc1)
102       activesupport (= 4.0.1.rc1)
103       rake (>= 0.8.7)
104       thor (>= 0.18.1, < 2.0)
105     rake (10.1.0)
106     sass (3.2.12)
107     sass-rails (4.0.1)
108       railties (>= 4.0.0, < 5.0)
109       sass (>= 3.1.10)
110       sprockets-rails (~> 2.0.0)
111     slop (3.4.6)
112     sprockets (2.10.0)
113       hike (~> 1.2)
114       multi_json (~> 1.0)
115       rack (~> 1.0)
116       tilt (~> 1.1, != 1.3.0)
117     sprockets-rails (2.0.1)
118       actionpack (>= 3.0)
119       activesupport (>= 3.0)
120       sprockets (~> 2.8)
121     thor (0.18.1)
122     thread_safe (0.1.3)
123       atomic
124     tilt (1.4.1)
125     tzinfo (0.3.38)
126     uglifier (2.2.1)
127       execjs (>= 0.3.0)
128       multi_json (~> 1.0, >= 1.0.2)
129
130 PLATFORMS
131   ruby
132
133 DEPENDENCIES
134   annotate
135   bcrypt-ruby (~> 3.0.0)
136   better_errors
137   binding_of_caller
138   coffee-rails
139   haml
140   jquery-rails
141   meta_request
142   nokogiri
143   pg
144   protected_attributes
145   pry-debugger
146   pry-rails
147   pry-stack_explorer
148   quiet_assets
149   rails
150   rails_12factor
151   sass-rails
152   uglifier

0 个答案:

没有答案