Skip to content
This repository has been archived by the owner on Dec 12, 2021. It is now read-only.

uninitialized constant YAML (NameError) #118

Open
adavia opened this issue Jul 21, 2015 · 5 comments
Open

uninitialized constant YAML (NameError) #118

adavia opened this issue Jul 21, 2015 · 5 comments

Comments

@adavia
Copy link

adavia commented Jul 21, 2015

I was following the exact same steps as mentioned in the docs but im getting this error when i restart my rails server

Exiting
/home/adavia/.rvm/gems/ruby-2.2.1/gems/private_pub-1.0.3/lib/private_pub.rb:21:in load_config': uninitialized constant YAML (NameError) from /home/adavia/.rvm/gems/ruby-2.2.1/gems/private_pub-1.0.3/lib/private_pub/engine.rb:8:inblock in class:Engine'
from /home/adavia/.rvm/gems/ruby-2.2.1/gems/railties-4.2.1/lib/rails/initializable.rb:30:in instance_exec' from /home/adavia/.rvm/gems/ruby-2.2.1/gems/railties-4.2.1/lib/rails/initializable.rb:30:inrun'
from /home/adavia/.rvm/gems/ruby-2.2.1/gems/railties-4.2.1/lib/rails/initializable.rb:55:in block in run_initializers' from /home/adavia/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:226:inblock in tsort_each'
from /home/adavia/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:348:in block (2 levels) in each_strongly_connected_component' from /home/adavia/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:429:ineach_strongly_connected_component_from'
from /home/adavia/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:347:in block in each_strongly_connected_component' from /home/adavia/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:345:ineach'
from /home/adavia/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:345:in call' from /home/adavia/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:345:ineach_strongly_connected_component'
from /home/adavia/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:224:in tsort_each' from /home/adavia/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:203:intsort_each'
from /home/adavia/.rvm/gems/ruby-2.2.1/gems/railties-4.2.1/lib/rails/initializable.rb:54:in run_initializers' from /home/adavia/.rvm/gems/ruby-2.2.1/gems/railties-4.2.1/lib/rails/application.rb:352:ininitialize!'
from /home/adavia/rails/social_chat/config/environment.rb:5:in <top (required)>' from /home/adavia/rails/social_chat/config.ru:3:inrequire'
from /home/adavia/rails/social_chat/config.ru:3:in block in <main>' from /home/adavia/.rvm/gems/ruby-2.2.1/gems/rack-1.6.1/lib/rack/builder.rb:55:ininstance_eval'
from /home/adavia/.rvm/gems/ruby-2.2.1/gems/rack-1.6.1/lib/rack/builder.rb:55:in initialize' from /home/adavia/rails/social_chat/config.ru:innew'
from /home/adavia/rails/social_chat/config.ru:in <main>' from /home/adavia/.rvm/gems/ruby-2.2.1/gems/rack-1.6.1/lib/rack/builder.rb:49:ineval'
from /home/adavia/.rvm/gems/ruby-2.2.1/gems/rack-1.6.1/lib/rack/builder.rb:49:in new_from_string' from /home/adavia/.rvm/gems/ruby-2.2.1/gems/rack-1.6.1/lib/rack/builder.rb:40:inparse_file'
from /home/adavia/.rvm/gems/ruby-2.2.1/gems/rack-1.6.1/lib/rack/server.rb:299:in build_app_and_options_from_config' from /home/adavia/.rvm/gems/ruby-2.2.1/gems/rack-1.6.1/lib/rack/server.rb:208:inapp'
from /home/adavia/.rvm/gems/ruby-2.2.1/gems/railties-4.2.1/lib/rails/commands/server.rb:61:in app' from /home/adavia/.rvm/gems/ruby-2.2.1/gems/rack-1.6.1/lib/rack/server.rb:336:inwrapped_app'
from /home/adavia/.rvm/gems/ruby-2.2.1/gems/railties-4.2.1/lib/rails/commands/server.rb:139:in log_to_stdout' from /home/adavia/.rvm/gems/ruby-2.2.1/gems/railties-4.2.1/lib/rails/commands/server.rb:78:instart'
from /home/adavia/.rvm/gems/ruby-2.2.1/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:80:in block in server' from /home/adavia/.rvm/gems/ruby-2.2.1/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:75:intap'
from /home/adavia/.rvm/gems/ruby-2.2.1/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:75:in server' from /home/adavia/.rvm/gems/ruby-2.2.1/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:39:inrun_command!'
from /home/adavia/.rvm/gems/ruby-2.2.1/gems/railties-4.2.1/lib/rails/commands.rb:17:in <top (required)>' from bin/rails:4:inrequire'
from bin/rails:4:in `

'

@shyam916
Copy link

shyam916 commented Dec 5, 2015

I am also facing the same issue. Did you find out the problem?

@adavia
Copy link
Author

adavia commented Dec 6, 2015

Yes. In your config/application.rb add require 'yaml'

@Li-Kevin
Copy link

I just met the same error as i run
$ rake db:migrate
and solved it by following your instruction, insert
require 'yaml'
in the config/application.rb file. Thanks a lot!

@horatiorosa
Copy link

Brilliant. adding require 'yaml' to the config/application.rb file worked perfectly.

@ghost
Copy link

ghost commented Aug 26, 2017

Thank you, require 'yaml' in application.rb worked for me too. As I'm just learning Ruby, this has helped me so very much.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants