2017-03-09 34 views
0

我正在通過installfest流程開始使用Ruby on Rails作爲odin項目,但我在最後階段沒有做到。我已按照指示安裝了他們所要求的所有內容,但是當我運行'rake db:migrate'時,我收到消息'系統找不到指定的路徑。' 我在網上找不到任何東西,我發現所有的解決方案都說目標文件有錯誤的代碼,但是當我按照建議更正時,我仍然得到相同的消息。installfest耙db:遷移系統找不到指定的路徑

我這樣做的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 
+0

編輯:如果你想知道什麼是批處理文件 @ECHO OFF IF NOT 「%〜F0」 == 「〜F0」 GOTO:WINNT @ 「%〜dp0ruby.exe」 「 C:/Users/emachnic/GitRepos/railsinstaller-windows/stage/Ruby2.2.0/bin/rails「%1%2%3%4%5%6%7%8%9 GOTO:EOF :WinNT @ 「%〜dp0ruby.exe」「%〜dpn0」%* – Gabi

+0

你可以發佈你的Gemfile.lock? – eiko

+0

@eiko我搜索了我的文件gemfile.lock並打開了第一個帶有崇高文本的第一個文件,這就是我發現的 – Gabi

回答

1

如果你還沒有想通了這一點的是,它看起來像運行軌道分貝:遷移應該是它在Rails5而不是耙分貝做的方式:遷移。

這是基於關閉此線程: https://www.reddit.com/r/rails/comments/60gjx3/help_when_using_rake_dbmigrate_i_get_return_error/

+0

我實際上可以通過在虛擬機上使用Ubuntu Linux操作系統而不是Windows來解決它,歡呼幫助。忘記在這裏更新。不知道如何關閉問題 – Gabi

+0

rails db:migrate曾感謝! – Aindriu

-1

錯誤是簡單示出rake db:migrate不工作。

安裝最新耙寶石: -

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

並重新啓動服務器:rails s

0

如果任何人面臨同樣的問題?這只是因爲db文件夾沒有開發sqlite3文件:development.sqlite3要解決它,轉到您的應用程序根目錄(即:博客,Todo [您的APP文件夾]),然後在終端上運行此命令: rails db:migrate RAILS_ENV=development

相關問題