Rails 4: display values ​​in this context are not allowed in row 2 of column 11 (Psych :: SyntaxError)?

I successfully installed rails 4 and created a project using rails 4.0.0

rails s 

first worked fine. But after adding the "devise" gem to the gemfile

  gem 'devise', '~> 3.0.0.rc' 

and starting the package installation, I get the following error. What is the cause of this error and what is its solution?

I also tried with the gem 'devise' section comment, but now I get the same error for every rails command.

 /home/siv/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/psych.rb:205:in `parse': (<unknown>): mapping values are not allowed in this context at line 2 column 11 (Psych::SyntaxError) from /home/siv/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/psych.rb:205:in `parse_stream' from /home/siv/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/psych.rb:153:in `parse' from /home/siv/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/psych.rb:129:in `load' from /home/siv/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/rubygems/config_file.rb:318:in `load_file' from /home/siv/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/rubygems/config_file.rb:191:in `initialize' from /home/siv/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/rubygems/gem_runner.rb:66:in `new' from /home/siv/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/rubygems/gem_runner.rb:66:in `do_configuration' from /home/siv/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/rubygems/gem_runner.rb:46:in `run' 

database.yml file

 development: adapter: mysql2 encoding: utf8 database: realstate_development pool: 5 username: root password: root socket: /var/run/mysqld/mysqld.sock 

gem 'devise' with any version, shows the following error in the package, if I remove devise gem, it works fine, I used rails 3.2.13, but I never encountered such a problem, which is strange.

 Fetching gem metadata from https://rubygems.org/......... Fetching gem metadata from https://rubygems.org/.. Unfortunately, a fatal error has occurred. Please see the Bundler troubleshooting documentation at http://bit.ly/bundler-issues. Thanks! /home/siv/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/psych.rb:205:in `parse': (<unknown>): mapping values are not allowed in this context at line 2 column 11 (Psych::SyntaxError) from /home/siv/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/psych.rb:205:in `parse_stream' from /home/siv/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/psych.rb:153:in `parse' from /home/siv/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/psych.rb:129:in `load' from /home/siv/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/config_file.rb:318:in `load_file' from /home/siv/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/config_file.rb:191:in `initialize' from /home/siv/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems.rb:319:in `new' from /home/siv/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems.rb:319:in `configuration' from /home/siv/.rvm/gems/ ruby-2.0.0-p247@global /gems/bundler-1.3.5/lib/bundler/rubygems_integration.rb:34:in `configuration' from /home/siv/.rvm/gems/ ruby-2.0.0-p247@global /gems/bundler-1.3.5/lib/bundler/rubygems_integration.rb:53:in `sources=' from /home/siv/.rvm/gems/ ruby-2.0.0-p247@global /gems/bundler-1.3.5/lib/bundler/source/rubygems.rb:250:in `remote_specs' from /home/siv/.rvm/gems/ ruby-2.0.0-p247@global /gems/bundler-1.3.5/lib/bundler/source/rubygems.rb:163:in `fetch_specs' from /home/siv/.rvm/gems/ ruby-2.0.0-p247@global /gems/bundler-1.3.5/lib/bundler/source/rubygems.rb:67:in `specs' from /home/siv/.rvm/gems/ ruby-2.0.0-p247@global /gems/bundler-1.3.5/lib/bundler/definition.rb:192:in `block (2 levels) in index' from /home/siv/.rvm/gems/ ruby-2.0.0-p247@global /gems/bundler-1.3.5/lib/bundler/definition.rb:189:in `each' from /home/siv/.rvm/gems/ ruby-2.0.0-p247@global /gems/bundler-1.3.5/lib/bundler/definition.rb:189:in `block in index' from /home/siv/.rvm/gems/ ruby-2.0.0-p247@global /gems/bundler-1.3.5/lib/bundler/index.rb:9:in `build' from /home/siv/.rvm/gems/ ruby-2.0.0-p247@global /gems/bundler-1.3.5/lib/bundler/definition.rb:185:in `index' from /home/siv/.rvm/gems/ ruby-2.0.0-p247@global /gems/bundler-1.3.5/lib/bundler/definition.rb:179:in `resolve' from /home/siv/.rvm/gems/ ruby-2.0.0-p247@global /gems/bundler-1.3.5/lib/bundler/definition.rb:114:in `specs' from /home/siv/.rvm/gems/ ruby-2.0.0-p247@global /gems/bundler-1.3.5/lib/bundler/definition.rb:109:in `resolve_remotely!' from /home/siv/.rvm/gems/ ruby-2.0.0-p247@global /gems/bundler-1.3.5/lib/bundler/installer.rb:83:in `run' from /home/siv/.rvm/gems/ ruby-2.0.0-p247@global /gems/bundler-1.3.5/lib/bundler/installer.rb:14:in `install' from /home/siv/.rvm/gems/ ruby-2.0.0-p247@global /gems/bundler-1.3.5/lib/bundler/cli.rb:247:in `install' from /home/siv/.rvm/gems/ ruby-2.0.0-p247@global /gems/bundler-1.3.5/lib/bundler/vendor/thor/task.rb:27:in `run' from /home/siv/.rvm/gems/ ruby-2.0.0-p247@global /gems/bundler-1.3.5/lib/bundler/vendor/thor/invocation.rb:120:in `invoke_task' from /home/siv/.rvm/gems/ ruby-2.0.0-p247@global /gems/bundler-1.3.5/lib/bundler/vendor/thor.rb:344:in `dispatch' from /home/siv/.rvm/gems/ ruby-2.0.0-p247@global /gems/bundler-1.3.5/lib/bundler/vendor/thor/base.rb:434:in `start' from /home/siv/.rvm/gems/ ruby-2.0.0-p247@global /gems/bundler-1.3.5/bin/bundle:20:in `block in <top (required)>' from /home/siv/.rvm/gems/ ruby-2.0.0-p247@global /gems/bundler-1.3.5/lib/bundler/friendly_errors.rb:3:in `with_friendly_errors' from /home/siv/.rvm/gems/ ruby-2.0.0-p247@global /gems/bundler-1.3.5/bin/bundle:20:in `<top (required)>' from /home/siv/.rvm/gems/ ruby-2.0.0-p247@global /bin/bundle:23:in `load' from /home/siv/.rvm/gems/ ruby-2.0.0-p247@global /bin/bundle:23:in `<main>' from /home/siv/.rvm/gems/ruby-2.0.0-p247/bin/ruby_noexec_wrapper:14:in `eval' from /home/siv/.rvm/gems/ruby-2.0.0-p247/bin/ruby_noexec_wrapper:14:in `<main>' 
+4
source share
2 answers

If someone still comes up with the same error, you can check the YAML files in your project. In this example, the problem is the missing padding in database.yml . It should look like this:

 development: adapter: mysql2 encoding: utf8 database: realstate_development pool: 5 username: root password: root socket: /var/run/mysqld/mysqld.sock 

I get the same error, but for other reasons, and the whole problem was in the wrong .yml application

+4
source

First, pay attention to the yml file, in which the analysis method does not work due to Psych :: SyntaxError. Then browse the file for the next

YAML files must be indented correctly and the correct syntax must be followed.
1. All members of the list are lines starting from the same level of indentation, starting with "-" (dashes and spaces):
Dictionary 2.A is presented in simple form: meaning (a colon must be followed by a space):
For more syntax related information, check out the following link: http://docs.ansible.com/ansible/YAMLSyntax.html

+1
source

Source: https://habr.com/ru/post/1501182/


All Articles