2017-05-22 6 views
1

rake db:migrateと同様rails serverを実行している間、私はこのエラーを取得しています、と私はあなたが明示的にGemfilegem "active_model_serializers", require: trueを書くことができrails-4.2.7`<トップ(必須)> ':初期化されていない定数ActiveModelSerializers(NameError)

api/config/initializers/active_model_serializers.rb:1:in `<top (required)>': uninitialized constant ActiveModelSerializers (NameError) 
from /home/ganeshmohan/.rvm/gems/ruby-2.2.5/gems/railties-4.2.8/lib/rails/engine.rb:652:in `block in load_config_initializer' 
from /home/ganeshmohan/.rvm/gems/ruby-2.2.5/gems/activesupport-4.2.8/lib/active_support/notifications.rb:166:in `instrument' 
from /home/ganeshmohan/.rvm/gems/ruby-2.2.5/gems/railties-4.2.8/lib/rails/engine.rb:651:in `load_config_initializer' 
from /home/ganeshmohan/.rvm/gems/ruby-2.2.5/gems/railties-4.2.8/lib/rails/engine.rb:616:in `block (2 levels) in <class:Engine>' 
from /home/ganeshmohan/.rvm/gems/ruby-2.2.5/gems/railties-4.2.8/lib/rails/engine.rb:615:in `each' 
from /home/ganeshmohan/.rvm/gems/ruby-2.2.5/gems/railties-4.2.8/lib/rails/engine.rb:615:in `block in <class:Engine>' 
from /home/ganeshmohan/.rvm/gems/ruby-2.2.5/gems/railties-4.2.8/lib/rails/initializable.rb:30:in `instance_exec' 
from /home/ganeshmohan/.rvm/gems/ruby-2.2.5/gems/railties-4.2.8/lib/rails/initializable.rb:30:in `run' 
from /home/ganeshmohan/.rvm/gems/ruby-2.2.5/gems/railties-4.2.8/lib/rails/initializable.rb:55:in `block in run_initializers' 
from /home/ganeshmohan/.rvm/rubies/ruby-2.2.5/lib/ruby/2.2.0/tsort.rb:226:in `block in tsort_each' 
from /home/ganeshmohan/.rvm/rubies/ruby-2.2.5/lib/ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component' 
from /home/ganeshmohan/.rvm/rubies/ruby-2.2.5/lib/ruby/2.2.0/tsort.rb:420:in `block (2 levels) in each_strongly_connected_component_from' 
from /home/ganeshmohan/.rvm/rubies/ruby-2.2.5/lib/ruby/2.2.0/tsort.rb:429:in `each_strongly_connected_component_from' 
from /home/ganeshmohan/.rvm/rubies/ruby-2.2.5/lib/ruby/2.2.0/tsort.rb:419:in `block in each_strongly_connected_component_from' 
from /home/ganeshmohan/.rvm/gems/ruby-2.2.5/gems/railties-4.2.8/lib/rails/initializable.rb:44:in `each' 
from /home/ganeshmohan/.rvm/gems/ruby-2.2.5/gems/railties-4.2.8/lib/rails/initializable.rb:44:in `tsort_each_child' 
from /home/ganeshmohan/.rvm/rubies/ruby-2.2.5/lib/ruby/2.2.0/tsort.rb:413:in `call' 
from /home/ganeshmohan/.rvm/rubies/ruby-2.2.5/lib/ruby/2.2.0/tsort.rb:413:in `each_strongly_connected_component_from' 
from /home/ganeshmohan/.rvm/rubies/ruby-2.2.5/lib/ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component' 
from /home/ganeshmohan/.rvm/rubies/ruby-2.2.5/lib/ruby/2.2.0/tsort.rb:345:in `each' 
from /home/ganeshmohan/.rvm/rubies/ruby-2.2.5/lib/ruby/2.2.0/tsort.rb:345:in `call' 
from /home/ganeshmohan/.rvm/rubies/ruby-2.2.5/lib/ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component' 
from /home/ganeshmohan/.rvm/rubies/ruby-2.2.5/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each' 
from /home/ganeshmohan/.rvm/rubies/ruby-2.2.5/lib/ruby/2.2.0/tsort.rb:203:in `tsort_each' 
from /home/ganeshmohan/.rvm/gems/ruby-2.2.5/gems/railties-4.2.8/lib/rails/initializable.rb:54:in `run_initializers' 
from /home/ganeshmohan/.rvm/gems/ruby-2.2.5/gems/railties-4.2.8/lib/rails/application.rb:352:in `initialize!' 
from /home/ganeshmohan/.rvm/gems/ruby-2.2.5/gems/railties-4.2.8/lib/rails/railtie.rb:194:in `public_send' 
from /home/ganeshmohan/.rvm/gems/ruby-2.2.5/gems/railties-4.2.8/lib/rails/railtie.rb:194:in `method_missing' 
from /home/ganeshmohan/work_space/Givecorps-site/config/environment.rb:19:in `<top (required)>' 
from /home/ganeshmohan/.rvm/gems/ruby-2.2.5/gems/skylight-1.2.2/lib/skylight/probes.rb:81:in `require' 
from /home/ganeshmohan/.rvm/gems/ruby-2.2.5/gems/skylight-1.2.2/lib/skylight/probes.rb:81:in `require' 
from /home/ganeshmohan/work_space/Givecorps-site/config.ru:3:in `block in <main>' 
from /home/ganeshmohan/.rvm/gems/ruby-2.2.5/gems/rack-1.6.8/lib/rack/builder.rb:55:in `instance_eval' 
from /home/ganeshmohan/.rvm/gems/ruby-2.2.5/gems/rack-1.6.8/lib/rack/builder.rb:55:in `initialize' 
from /home/ganeshmohan/work_space/Givecorps-site/config.ru:in `new' 
from /home/ganeshmohan/work_space/Givecorps-site/config.ru:in `<main>' 
from /home/ganeshmohan/.rvm/gems/ruby-2.2.5/gems/rack-1.6.8/lib/rack/builder.rb:49:in `eval' 
from /home/ganeshmohan/.rvm/gems/ruby-2.2.5/gems/rack-1.6.8/lib/rack/builder.rb:49:in `new_from_string' 
from /home/ganeshmohan/.rvm/gems/ruby-2.2.5/gems/rack-1.6.8/lib/rack/builder.rb:40:in `parse_file' 
from /home/ganeshmohan/.rvm/gems/ruby-2.2.5/gems/rack-1.6.8/lib/rack/server.rb:300:in `build_app_and_options_from_config' 
from /home/ganeshmohan/.rvm/gems/ruby-2.2.5/gems/rack-1.6.8/lib/rack/server.rb:209:in `app' 
from /home/ganeshmohan/.rvm/gems/ruby-2.2.5/gems/railties-4.2.8/lib/rails/commands/server.rb:61:in `app' 
from /home/ganeshmohan/.rvm/gems/ruby-2.2.5/gems/rack-1.6.8/lib/rack/server.rb:337:in `wrapped_app' 
from /home/ganeshmohan/.rvm/gems/ruby-2.2.5/gems/railties-4.2.8/lib/rails/commands/server.rb:139:in `log_to_stdout' 
from /home/ganeshmohan/.rvm/gems/ruby-2.2.5/gems/railties-4.2.8/lib/rails/commands/server.rb:78:in `start' 
from /home/ganeshmohan/.rvm/gems/ruby-2.2.5/gems/railties-4.2.8/lib/rails/commands/commands_tasks.rb:80:in `block in server' 
from /home/ganeshmohan/.rvm/gems/ruby-2.2.5/gems/railties-4.2.8/lib/rails/commands/commands_tasks.rb:75:in `tap' 
from /home/ganeshmohan/.rvm/gems/ruby-2.2.5/gems/railties-4.2.8/lib/rails/commands/commands_tasks.rb:75:in `server' 
from /home/ganeshmohan/.rvm/gems/ruby-2.2.5/gems/railties-4.2.8/lib/rails/commands/commands_tasks.rb:39:in `run_command!' 
from /home/ganeshmohan/.rvm/gems/ruby-2.2.5/gems/railties-4.2.8/lib/rails/commands.rb:17:in `<top (required)>' 
from /home/ganeshmohan/work_space/Givecorps-site/bin/rails:10:in `require' 
from /home/ganeshmohan/work_space/Givecorps-site/bin/rails:10:in `<top (required)>' 
from /home/ganeshmohan/.rvm/gems/ruby-2.2.5/gems/spring-2.0.1/lib/spring/client/rails.rb:28:in `load' 
from /home/ganeshmohan/.rvm/gems/ruby-2.2.5/gems/spring-2.0.1/lib/spring/client/rails.rb:28:in `call' 
from /home/ganeshmohan/.rvm/gems/ruby-2.2.5/gems/spring-2.0.1/lib/spring/client/command.rb:7:in `call' 
from /home/ganeshmohan/.rvm/gems/ruby-2.2.5/gems/spring-2.0.1/lib/spring/client.rb:30:in `run' 
from /home/ganeshmohan/.rvm/gems/ruby-2.2.5/gems/spring-2.0.1/bin/spring:49:in `<top (required)>' 
from /home/ganeshmohan/.rvm/gems/ruby-2.2.5/gems/spring-2.0.1/lib/spring/binstub.rb:31:in `load' 
from /home/ganeshmohan/.rvm/gems/ruby-2.2.5/gems/spring-2.0.1/lib/spring/binstub.rb:31:in `<top (required)>' 
from /home/ganeshmohan/.rvm/rubies/ruby-2.2.5/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:69:in `require' 
from /home/ganeshmohan/.rvm/rubies/ruby-2.2.5/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:69:in `require' 
from /home/ganeshmohan/work_space/Givecorps-site/bin/spring:16:in `<top (required)>' 
from bin/rails:3:in `load' 
from bin/rails:3:in `<main>' 

答えて

0

を使用しています代わりにconfig/application.rb

OR

でそれを必要とするのは、Gemfile

に宝石の下に追加しよう
gem "rails", "~> 5.0.0" 
gem "rack-cors" 
gem "active_model_serializers", "~> 0.10.0" 
+0

その別のエラー –

+0

を取得し、動作していないあなたはGemfile' 'で宝石「active_model_serializers」を追加したと' bundle' – puneet18

+0

すでに追加仲間を実行しますが、それでもそのはあなたの助け仲間のため –

関連する問題