Im having a problem with running my rails server. ive set the abstract_mysql2_adapters at initializer that consist of:
class ActiveRecord::ConnectionAdapters::Mysql2Adapter
NATIVE_DATABASE_TYPES[:primary_key] = "int(11) auto_increment PRIMARY KEY"
end
and it solved my rake db:migrate problem, but when i try to run my rails server it gives me this error.
C:/Users/XXXX/Documents/RoRCmS/simple_cms/config/initializers/abstract_mysql2_adapter.rb:2:in
<class:Mysql2Adapter>': uninitialized constant ActiveRecord::ConnectionAda pters::Mysql2Adapter::NATIVE_DATABASE_TYPES (NameError) from C:/Users/John/Documents/RoRCmS/simple_cms/config/initializers/abstract_mysql2_adapter.rb:1:in
' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-4.0.0/lib/rails/engine.rb:609:inblock (2 levels) in <class:Engine>' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-4.0.0/lib/rails/engine.rb:608:in
each' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-4.0.0/lib/rails/engine.rb:608:inblock in <class:Engine>' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-4.0.0/lib/rails/initializable.rb:30:in
instance_exec' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-4.0.0/lib/rails/initializable.rb:30:inrun' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-4.0.0/lib/rails/initializable.rb:55:in
block in run_initializers' from C:/Ruby23-x64/lib/ruby/2.3.0/tsort.rb:228:inblock in tsort_each' from C:/Ruby23-x64/lib/ruby/2.3.0/tsort.rb:350:in
block (2 levels) in each_strongly_connected_component' from C:/Ruby23-x64/lib/ruby/2.3.0/tsort.rb:431:ineach_strongly_connected_component_from' from C:/Ruby23-x64/lib/ruby/2.3.0/tsort.rb:349:in
block in each_strongly_connected_component' from C:/Ruby23-x64/lib/ruby/2.3.0/tsort.rb:347:ineach' from C:/Ruby23-x64/lib/ruby/2.3.0/tsort.rb:347:in
call' from C:/Ruby23-x64/lib/ruby/2.3.0/tsort.rb:347:ineach_strongly_connected_component' from C:/Ruby23-x64/lib/ruby/2.3.0/tsort.rb:226:in
tsort_each' from C:/Ruby23-x64/lib/ruby/2.3.0/tsort.rb:205:intsort_each' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-4.0.0/lib/rails/initializable.rb:54:in
run_initializers' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-4.0.0/lib/rails/application.rb:215:ininitialize!' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-4.0.0/lib/rails/railtie/configurable.rb:30:in
method_missing' from C:/Users/John/Documents/RoRCmS/simple_cms/config/environment.rb:5:in<top (required)>' from C:/Users/John/Documents/RoRCmS/simple_cms/config.ru:3:in
require' from C:/Users/John/Documents/RoRCmS/simple_cms/config.ru:3:inblock in <main>' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/rack-1.5.5/lib/rack/builder.rb:55:in
instance_eval' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/rack-1.5.5/lib/rack/builder.rb:55:ininitialize' from C:/Users/John/Documents/RoRCmS/simple_cms/config.ru:in
new' from C:/Users/John/Documents/RoRCmS/simple_cms/config.ru:in<main>' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/rack-1.5.5/lib/rack/builder.rb:49:in
eval' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/rack-1.5.5/lib/rack/builder.rb:49:innew_from_string' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/rack-1.5.5/lib/rack/builder.rb:40:in
parse_file' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/rack-1.5.5/lib/rack/server.rb:277:inbuild_app_and_options_from_config' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/rack-1.5.5/lib/rack/server.rb:199:in
app' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-4.0.0/lib/rails/commands/server.rb:48:inapp' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/rack-1.5.5/lib/rack/server.rb:314:in
wrapped_app' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-4.0.0/lib/rails/commands/server.rb:75:instart' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-4.0.0/lib/rails/commands.rb:78:in
block in ' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-4.0.0/lib/rails/commands.rb:73:intap' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-4.0.0/lib/rails/commands.rb:73:in
' from bin/rails:4:inrequire' from bin/rails:4:in
'
I really need to solve this problem now.. thanks guys.
Aucun commentaire:
Enregistrer un commentaire