Пытаюсь установить spree, но не могу запустить базу данных

#ruby-on-rails #rake #spree

#ruby-on-rails #грабли #spree

Вопрос:

Я работаю с spree, что для меня совершенно ново. Я следую руководству по началу работы, которое можно найти в разделе spree- начало работы. К сожалению, всякий раз, когда я добираюсь до шага 4.4.2, который говорит мне вызвать команду «rake db: create», я получаю следующую ошибку. Я застрял, и любая помощь была бы очень признательна. Спасибо.

   C:Ruby192binruby.exe -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) C:Ruby192binrake db:create --trace
    DEPRECATION WARNING: class_inheritable_attribute is deprecated, please use class_attribute method instead. Notice their behavior are slightly different, so refer to class_attribute documentation first. (called from <top (required)> at C:/Users/Edu/RubymineProjects/myStore/config/application.rb:7)
    DEPRECATION WARNING: class_inheritable_attribute is deprecated, please use class_attribute method instead. Notice their behavior are slightly different, so refer to class_attribute documentation first. (called from <top (required)> at C:/Users/Edu/RubymineProjects/myStore/config/application.rb:7)
    DEPRECATION WARNING: class_inheritable_attribute is deprecated, please use class_attribute method instead. Notice their behavior are slightly different, so refer to class_attribute documentation first. (called from <top (required)> at C:/Users/Edu/RubymineProjects/myStore/config/application.rb:7)
    DEPRECATION WARNING: class_inheritable_attribute is deprecated, please use class_attribute method instead. Notice their behavior are slightly different, so refer to class_attribute documentation first. (called from <top (required)> at C:/Users/Edu/RubymineProjects/myStore/config/application.rb:7)
    DEPRECATION WARNING: ref is deprecated and will be removed from Rails 3.2. (called from <top (required)> at C:/Users/Edu/RubymineProjects/myStore/config/application.rb:7)
    DEPRECATION WARNING: new is deprecated and will be removed from Rails 3.2. (called from <top (required)> at C:/Users/Edu/RubymineProjects/myStore/config/application.rb:7)
    ** Invoke db:create (first_time)
    ** Invoke db:load_config (first_time)
    ** Invoke rails_env (first_time)
    ** Execute rails_env
    ** Execute db:load_config
    rake aborted!
    syntax error on line 18, col 2: `  host: localhost'
    C:/Ruby192/lib/ruby/1.9.1/syck.rb:135:in `load'
    C:/Ruby192/lib/ruby/1.9.1/syck.rb:135:in `load'
    C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1.rc2/lib/rails/application/configuration.rb:105:in `database_configuration'
    C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.1.1.rc2/lib/active_record/railties/databases.rake:6:in `block (2 levels) in <top (required)>'
    C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.3.beta.1/lib/rake/task.rb:205:in `call'
    C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.3.beta.1/lib/rake/task.rb:205:in `block in execute'
    C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.3.beta.1/lib/rake/task.rb:200:in `each'
    C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.3.beta.1/lib/rake/task.rb:200:in `execute'
    C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.3.beta.1/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
    C:/Ruby192/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
    C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.3.beta.1/lib/rake/task.rb:151:in `invoke_with_call_chain'
    C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.3.beta.1/lib/rake/task.rb:176:in `block in invoke_prerequisites'
    C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.3.beta.1/lib/rake/task.rb:174:in `each'
    C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.3.beta.1/lib/rake/task.rb:174:in `invoke_prerequisites'
    C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.3.beta.1/lib/rake/task.rb:157:in `block in invoke_with_call_chain'
    C:/Ruby192/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
    C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.3.beta.1/lib/rake/task.rb:151:in `invoke_with_call_chain'
    C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.3.beta.1/lib/rake/task.rb:144:in `invoke'
    C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.3.beta.1/lib/rake/application.rb:114:in `invoke_task'
    C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.3.beta.1/lib/rake/application.rb:93:in `block in top_level'
    C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.3.beta.1/lib/rake/application.rb:93:in `each'
    C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.3.beta.1/lib/rake/application.rb:93:in `top_level'
    C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.3.beta.1/lib/rake/application.rb:66:in `block in run'
    C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.3.beta.1/lib/rake/application.rb:131:in `standard_exception_handling'
    C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.3.beta.1/lib/rake/application.rb:63:in `run'
    C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.3.beta.1/bin/rake:37:in `<top (required)>'
    C:/Ruby192/bin/rake:19:in `load'
    C:/Ruby192/bin/rake:19:in `<top (required)>'
    -e:1:in `load'
    -e:1:in `<main>'
    Tasks: TOP => db:create => db:load_config

    Process finished with exit code 1
 

Ответ №1:

Эта ошибка возникает, когда ваш database.yml файл содержит недопустимые символы, возможно, табуляции вместо пробелов. Дважды проверьте это и посмотрите, исправит ли это.