我试图让一个rails服务器运行,我正在与其他人一起工作。他创建了所有的init文件,但我似乎无法在我的计算机上运行它。
我收到此错误:引发ActiveRecord :: NoDatabaseError
找到了一个我应该运行rake db:create && rake db:migrate
我可以运行第一个命令,当我运行rake db:migrate
时出现以下错误:
NameError:未定义的局部变量或方法`rvm' for 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
感谢。