0

I have a really strange issue. I'm trying to deploy my app to a vps. After creating a database for it, when I'm trying to migrate my db I get this error:

YAML syntax error occurred while parsing /root/projects/bbla/config/database.yml. Please note that YAML must be consistently indented using spaces. Tabs are not allowed. Error: (<unknown>): found a tab character that violate intendation while scanning a plain scalar at line 15 column 13
/root/projects/bbla/config/environment.rb:5:in `<top (required)>'
Psych::SyntaxError: (<unknown>): found a tab character that violate intendation while scanning a plain scalar at line 15 column 13
/root/projects/bbla/config/environment.rb:5:in `<top (required)>'
Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)

And here is my database.yml:

development:
  adapter: sqlite3
  database: db/development.sqlite3

test:
  adapter: sqlite3
  database: db/test.sqlite3
  pool: 5
  timeout: 5000

production:
  adapter: postgresql
  database: bbla
  host: localhost
  password: secret

I've already spent several hours trying to figure it out, but still no luck! Maybe someone can see the problem.

I've already checked my code in online yml validator, and it says it's ok.

Many thanks in advance!

UPDATE Solved by Arup Rakshit! That was a strange glitch (bad invisible characters probably). Helped to delete the database.yml and create it again, no copy/past.

Daria Voronova
  • 123
  • 2
  • 9
  • `found a tab character that violate intendation while scanning...`, how about try replacing all space/tab with space? – Hieu Pham Feb 02 '16 at 04:58
  • @HieuPham, thanks for reply! That was the first thing, I did. I've replaced the file and searched tabs in there, there are no tabs. It doesn't work for some reason. – Daria Voronova Feb 02 '16 at 05:02
  • Tabs are forbidden in YAML (http://www.yaml.org/faq.html). I think you may have a hard tab setting in your editor or it might have slipped in some way. As @HieuPham said try replacing the tabs by spaces and also check the settings of your editor. It's a good practice to use soft tabs. – harshs08 Feb 02 '16 at 05:05
  • Check this out http://stackoverflow.com/a/5107098/1789479 – Hieu Pham Feb 02 '16 at 05:08
  • 2
    @DariaVoronova There may be some invisible bad characters. Create a new file, and write there manually. Don't copy/paste. – Arup Rakshit Feb 02 '16 at 05:13
  • @ArupRakshit, omg!! You're my savior! Really such an easy solution, just to recreate the file!! Thanks again for your help =) I've just migrated my db. – Daria Voronova Feb 02 '16 at 05:19

0 Answers0