Ошибка: 'NameError: неопределенная локальная переменная или метод `rvm' для main: Object 'после запуска rake db: migrate - PullRequest
0 голосов
/ 11 июня 2018

Я пытаюсь запустить сервер rails, над которым я работаю с кем-то еще.Он создал все файлы инициализации, и я не могу заставить его работать на моем компьютере.

Я получил эту ошибку: поднять ActiveRecord :: NoDatabaseError

и нашел решение, которое я должен запустить rake db:create && rake db:migrate

Я могу получить первую команду для запуска, когдаЯ запускаю rake db:migrate Я получаю следующую ошибку:

NameError: неопределенная локальная переменная или метод `rvm 'для main: Object

Вот полный следКоманда:

** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:migrate
rake aborted!
NameError: undefined local variable or method `rvm' for main:Object
/Users/edan/Documents/Code/GitHub/Beer2Bar-Server/db/migrate/20180523035000_devise_create_users.rb:1:in `<top (required)>'
/usr/local/lib/ruby/gems/2.5.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `require'
/usr/local/lib/ruby/gems/2.5.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `block in require'
/usr/local/lib/ruby/gems/2.5.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:258:in `load_dependency'
/usr/local/lib/ruby/gems/2.5.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `require'
/usr/local/lib/ruby/gems/2.5.0/gems/activerecord-5.1.6/lib/active_record/migration.rb:962:in `load_migration'
/usr/local/lib/ruby/gems/2.5.0/gems/activerecord-5.1.6/lib/active_record/migration.rb:958:in `migration'
/usr/local/lib/ruby/gems/2.5.0/gems/activerecord-5.1.6/lib/active_record/migration.rb:953:in `disable_ddl_transaction'
/usr/local/lib/ruby/gems/2.5.0/gems/activerecord-5.1.6/lib/active_record/migration.rb:1305:in `use_transaction?'
/usr/local/lib/ruby/gems/2.5.0/gems/activerecord-5.1.6/lib/active_record/migration.rb:1235:in `rescue in execute_migration_in_transaction'
/usr/local/lib/ruby/gems/2.5.0/gems/activerecord-5.1.6/lib/active_record/migration.rb:1223:in `execute_migration_in_transaction'
/usr/local/lib/ruby/gems/2.5.0/gems/activerecord-5.1.6/lib/active_record/migration.rb:1201:in `block in migrate_without_lock'
/usr/local/lib/ruby/gems/2.5.0/gems/activerecord-5.1.6/lib/active_record/migration.rb:1200:in `each'
/usr/local/lib/ruby/gems/2.5.0/gems/activerecord-5.1.6/lib/active_record/migration.rb:1200:in `migrate_without_lock'
/usr/local/lib/ruby/gems/2.5.0/gems/activerecord-5.1.6/lib/active_record/migration.rb:1148:in `block in migrate'
/usr/local/lib/ruby/gems/2.5.0/gems/activerecord-5.1.6/lib/active_record/migration.rb:1317:in `with_advisory_lock'
/usr/local/lib/ruby/gems/2.5.0/gems/activerecord-5.1.6/lib/active_record/migration.rb:1148:in `migrate'
/usr/local/lib/ruby/gems/2.5.0/gems/activerecord-5.1.6/lib/active_record/migration.rb:1007:in `up'
/usr/local/lib/ruby/gems/2.5.0/gems/activerecord-5.1.6/lib/active_record/migration.rb:985:in `migrate'
/usr/local/lib/ruby/gems/2.5.0/gems/activerecord-5.1.6/lib/active_record/tasks/database_tasks.rb:171:in `migrate'
/usr/local/lib/ruby/gems/2.5.0/gems/activerecord-5.1.6/lib/active_record/railties/databases.rake:58:in `block (2 levels) in <top (required)>'
/usr/local/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/task.rb:271:in `block in execute'
/usr/local/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/task.rb:271:in `each'
/usr/local/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/task.rb:271:in `execute'
/usr/local/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/task.rb:213:in `block in invoke_with_call_chain'
/usr/local/Cellar/ruby/2.5.1/lib/ruby/2.5.0/monitor.rb:226:in `mon_synchronize'
/usr/local/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/task.rb:193:in `invoke_with_call_chain'
/usr/local/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/task.rb:182:in `invoke'
/usr/local/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:160:in `invoke_task'
/usr/local/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/usr/local/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:116:in `each'
/usr/local/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:116:in `block in top_level'
/usr/local/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:125:in `run_with_threads'
/usr/local/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:110:in `top_level'
/usr/local/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:83:in `block in run'
/usr/local/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:186:in `standard_exception_handling'
/usr/local/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:80:in `run'
/usr/local/lib/ruby/gems/2.5.0/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
/usr/local/bin/rake:23:in `load'
/usr/local/bin/rake:23:in `<main>'

Caused by:
NameError: undefined local variable or method `rvm' for main:Object
/Users/edan/Documents/Code/GitHub/Beer2Bar-Server/db/migrate/20180523035000_devise_create_users.rb:1:in `<top (required)>'
/usr/local/lib/ruby/gems/2.5.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `require'
/usr/local/lib/ruby/gems/2.5.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `block in require'
/usr/local/lib/ruby/gems/2.5.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:258:in `load_dependency'
/usr/local/lib/ruby/gems/2.5.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `require'
/usr/local/lib/ruby/gems/2.5.0/gems/activerecord-5.1.6/lib/active_record/migration.rb:962:in `load_migration'
/usr/local/lib/ruby/gems/2.5.0/gems/activerecord-5.1.6/lib/active_record/migration.rb:958:in `migration'
/usr/local/lib/ruby/gems/2.5.0/gems/activerecord-5.1.6/lib/active_record/migration.rb:953:in `disable_ddl_transaction'
/usr/local/lib/ruby/gems/2.5.0/gems/activerecord-5.1.6/lib/active_record/migration.rb:1305:in `use_transaction?'
/usr/local/lib/ruby/gems/2.5.0/gems/activerecord-5.1.6/lib/active_record/migration.rb:1297:in `ddl_transaction'
/usr/local/lib/ruby/gems/2.5.0/gems/activerecord-5.1.6/lib/active_record/migration.rb:1229:in `execute_migration_in_transaction'
/usr/local/lib/ruby/gems/2.5.0/gems/activerecord-5.1.6/lib/active_record/migration.rb:1201:in `block in migrate_without_lock'
/usr/local/lib/ruby/gems/2.5.0/gems/activerecord-5.1.6/lib/active_record/migration.rb:1200:in `each'
/usr/local/lib/ruby/gems/2.5.0/gems/activerecord-5.1.6/lib/active_record/migration.rb:1200:in `migrate_without_lock'
/usr/local/lib/ruby/gems/2.5.0/gems/activerecord-5.1.6/lib/active_record/migration.rb:1148:in `block in migrate'
/usr/local/lib/ruby/gems/2.5.0/gems/activerecord-5.1.6/lib/active_record/migration.rb:1317:in `with_advisory_lock'
/usr/local/lib/ruby/gems/2.5.0/gems/activerecord-5.1.6/lib/active_record/migration.rb:1148:in `migrate'
/usr/local/lib/ruby/gems/2.5.0/gems/activerecord-5.1.6/lib/active_record/migration.rb:1007:in `up'
/usr/local/lib/ruby/gems/2.5.0/gems/activerecord-5.1.6/lib/active_record/migration.rb:985:in `migrate'
/usr/local/lib/ruby/gems/2.5.0/gems/activerecord-5.1.6/lib/active_record/tasks/database_tasks.rb:171:in `migrate'
/usr/local/lib/ruby/gems/2.5.0/gems/activerecord-5.1.6/lib/active_record/railties/databases.rake:58:in `block (2 levels) in <top (required)>'
/usr/local/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/task.rb:271:in `block in execute'
/usr/local/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/task.rb:271:in `each'
/usr/local/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/task.rb:271:in `execute'
/usr/local/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/task.rb:213:in `block in invoke_with_call_chain'
/usr/local/Cellar/ruby/2.5.1/lib/ruby/2.5.0/monitor.rb:226:in `mon_synchronize'
/usr/local/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/task.rb:193:in `invoke_with_call_chain'
/usr/local/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/task.rb:182:in `invoke'
/usr/local/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:160:in `invoke_task'
/usr/local/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/usr/local/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:116:in `each'
/usr/local/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:116:in `block in top_level'
/usr/local/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:125:in `run_with_threads'
/usr/local/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:110:in `top_level'
/usr/local/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:83:in `block in run'
/usr/local/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:186:in `standard_exception_handling'
/usr/local/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:80:in `run'
/usr/local/lib/ruby/gems/2.5.0/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
/usr/local/bin/rake:23:in `load'
/usr/local/bin/rake:23:in `<main>'
Tasks: TOP => db:migrate

Спасибо.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...