简体   繁体   English

installfest rake db:migrate系统找不到指定的路径

[英]installfest rake db:migrate the system cannot find the path specified

I am going through the installfest process to get started with Ruby on Rails for the odin project, but I'm falling short at the final stage. 我正在经历installfest流程,以开始odin项目的Ruby on Rails,但在最后阶段还不够。 I've installed everything they asked exactly as instructed, but when I run 'rake db:migrate' i get the message 'The system cannot find the path specified.' 我已经按照指示完全安装了他们要求的所有内容,但是当我运行“ rake db:migrate”时,我收到消息“系统找不到指定的路径”。 I cant find anything for this on the internet, the solutions I've found all say the target file has the wrong code but when I correct as advised I still get the same message. 我在互联网上找不到任何东西,我发现的解决方案都说目标文件的代码错误,但是当我按照建议纠正时,仍然会收到相同的消息。

I am doing this for a windows system. 我正在为Windows系统执行此操作。

C:\Users\Olaoluwa>rails -v
Rails 5.0.2

C:\Users\Olaoluwa>cd c:\Sites

c:\Sites>mkdir railsbridge
A subdirectory or file railsbridge already exists.

c:\Sites>cd railsbridge

c:\Sites\railsbridge>cd test_app

c:\Sites\railsbridge\test_app>rails s
=> Booting Puma
=> Rails 5.0.2 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
*** SIGUSR2 not implemented, signal based restart unavailable!
*** SIGUSR1 not implemented, signal based restart unavailable!
*** SIGHUP not implemented, signal based logs reopening unavailable!
Puma starting in single mode...
* Version 3.7.1 (ruby 2.3.3-p222), codename: Snowy Sagebrush
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://localhost:3000
Use Ctrl-C to stop
Exiting
Terminate batch job (Y/N)? y

c:\Sites\railsbridge\test_app>rake db:migrate
The system cannot find the path specified.

c:\Sites\railsbridge\test_app>

Edit: 
my gemfile.lock shows
GEM
remote: https://rubygems.org/
specs:
codeclimate-test-reporter (0.3.0)
  simplecov (>= 0.7.1, < 1.0.0)
diff-lcs (1.2.3)
docile (1.1.3)
multi_json (1.9.0)
rack (1.5.2)
rack-protection (1.5.0)
  rack
rake (10.0.4)
rspec (2.13.0)
  rspec-core (~> 2.13.0)
  rspec-expectations (~> 2.13.0)
  rspec-mocks (~> 2.13.0)
rspec-core (2.13.1)
rspec-expectations (2.13.0)
  diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.13.1)
simplecov (0.8.2)
  docile (~> 1.1.0)
  multi_json
  simplecov-html (~> 0.8.0)
simplecov-html (0.8.0)
sinatra (1.4.2)
  rack (~> 1.5, >= 1.5.2)
  rack-protection (~> 1.4)
  tilt (~> 1.3, >= 1.3.4)
tilt (1.3.7)

PLATFORMS
java
ruby

DEPENDENCIES
codeclimate-test-reporter
rack
rake
rspec
sinatra

If you haven't figured this out yet, it looks like running rails db:migrate should be the way it's done in Rails5 instead of rake db:migrate. 如果您还没有弄清楚,似乎应该在Rails5中运行rails db:migrate而不是使用rake db:migrate。

This is based off of this thread: https://www.reddit.com/r/rails/comments/60gjx3/help_when_using_rake_dbmigrate_i_get_return_error/ 这基于以下线程: https : //www.reddit.com/r/rails/comments/60gjx3/help_when_using_rake_dbmigrate_i_get_return_error/

If anyone faces the same problem?! 如果有人遇到同样的问题? This just because the db folder does not has the development sqlite3 file : development.sqlite3 To solve it, go to your app root directory (ie: Blog, Todo [YOUR APP FOLDER]) then run this command on terminal : rails db:migrate RAILS_ENV=development 这仅仅是因为db文件夹没有开发sqlite3文件: development.sqlite3要解决该问题,请转到您的应用程序根目录(即:Blog,Todo [您的应用程序文件夹]),然后在终端上运行此命令: rails db:migrate RAILS_ENV=development

The error is simply showing rake db:migrate is not working. 错误只是显示rake db:migrate无法正常工作。

install latest rake gem:- 安装最新的rake gem:-

gem 'rake', '~> 11.2', '>= 11.2.2' gem install rake -v 11.2.2 gem 'rake', '~> 11.2', '>= 11.2.2' gem install rake -v 11.2.2

and restart the server: rails s 并重新启动服务器: rails s

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM