我正在通过installfest流程开始使用Ruby on Rails进行odin项目,但是我在最后阶段做得不够。我按照指示安装了他们所要求的所有内容,但是当我运行“rake db:migrate'我收到消息'系统找不到指定的路径。' 我无法在互联网上找到任何相关内容,我发现解决方案都说目标文件的代码错误但是当我按照建议更正时,我仍然会得到相同的消息。
我正在为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 :(得分:1)
如果你还没有想到这一点,看起来像运行rails db:migrate应该是它在Rails5中完成的方式,而不是rake db:migrate。
这是基于这个主题: https://www.reddit.com/r/rails/comments/60gjx3/help_when_using_rake_dbmigrate_i_get_return_error/
答案 1 :(得分:0)
如果有人面临同样的问题?!这只是因为db文件夹没有开发sqlite3文件: development.sqlite3 要解决它,请转到你的app根目录(即:Blog,Todo [你的APP] FOLDER])然后在终端上运行此命令:innerChar = input("enter the inner char ")
outerChar = input("enter the outer char ")
rows = int(input("enter the number of inner rows "))
for r in range(2 * rows):
#print the white space on the left
print(' ' * 2 * (2 * rows-r), end='')
if r < rows:
#top triangle
print((outerChar+' ') * (2*r + 1))
else:
#working with the row modulo 2
r %= rows
#bottom three triangles
print((outerChar+' ') * (2*r + 1), end='')
print((innerChar+' ') * (2*(rows-r) - 1), end='')
print((outerChar+' ') * (2*r + 1))
答案 2 :(得分:-1)
错误只是显示rake db:migrate
无效。
安装最新的rake gem: -
gem 'rake', '~> 11.2', '>= 11.2.2'
gem install rake -v 11.2.2
并重新启动服务器:rails s