2017-05-03 57 views
5

我想建立寧靜的使用API​​軌軌道5 - 能不能產生RSpec的:安裝

我下面的博客鏈接教程摸出

https://scotch.io/tutorials/build-a-restful-json-api-with-rails-5-part-one

但是當我執行下列指令

rails generate rspec:install

它會生成以下錯誤

identical .rspec 
     exist spec 
     create spec/C:/Users/Shad Munir/AppData/Local/Temp/d20170503-6768-l4n0e9/spec/spec_helper.rb 
C:/Ruby23-x64/lib/ruby/2.3.0/fileutils.rb:253:in `mkdir': Invalid argument @ dir_s_mkdir - E:/todos-api/spec/C: (Errno::EINVAL) 
     from C:/Ruby23-x64/lib/ruby/2.3.0/fileutils.rb:253:in `fu_mkdir' 
     from C:/Ruby23-x64/lib/ruby/2.3.0/fileutils.rb:227:in `block (2 levels) in mkdir_p' 
     from C:/Ruby23-x64/lib/ruby/2.3.0/fileutils.rb:225:in `reverse_each' 
     from C:/Ruby23-x64/lib/ruby/2.3.0/fileutils.rb:225:in `block in mkdir_p' 
     from C:/Ruby23-x64/lib/ruby/2.3.0/fileutils.rb:211:in `each' 
     from C:/Ruby23-x64/lib/ruby/2.3.0/fileutils.rb:211:in `mkdir_p' 
     from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/actions/create_file.rb:61:in `block in invoke!' 
     from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/actions/empty_directory.rb:116:in `invoke_with_conflict_check' 
     from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/actions/create_file.rb:60:in `invoke!' 
     from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/actions.rb:95:in `action' 
     from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/actions/create_file.rb:25:in `create_file' 
     from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/actions/file_manipulation.rb:27:in `copy_file' 
     from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/actions/directory.rb:94:in `block in execute!' 
     from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/actions/directory.rb:80:in `each' 
     from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/actions/directory.rb:80:in `execute!' 
     from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/actions/directory.rb:66:in `invoke!' 
     from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/actions.rb:95:in `action' 
     from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/actions/directory.rb:52:in `directory' 
     from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/rspec-rails-3.5.2/lib/generators/rspec/install/install_generator.rb:23:in `block in copy_spec_files' 
     from C:/Ruby23-x64/lib/ruby/2.3.0/tmpdir.rb:89:in `mktmpdir' 
     from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/rspec-rails-3.5.2/lib/generators/rspec/install/install_generator.rb:20:in `copy_spec_files' 
     from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/command.rb:27:in `run' 
     from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/invocation.rb:126:in `invoke_command' 
     from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/invocation.rb:133:in `block in invoke_all' 
     from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/invocation.rb:133:in `each' 
     from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/invocation.rb:133:in `map' 
     from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/invocation.rb:133:in `invoke_all' 
     from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/group.rb:232:in `dispatch' 
     from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/base.rb:444:in `start' 
     from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/generators.rb:180:in `invoke' 
     from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/commands/generate.rb:13:in `<top (required)>' 
     from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:293:in `require' 
     from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:293:in `block in require' 
     from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:259:in `load_dependency' 
     from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:293:in `require' 
     from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:138:in `require_command!' 
     from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:145:in `generate_or_destroy' 
     from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:60:in `generate' 
     from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:49:in `run_command!' 
     from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/commands.rb:18:in `<top (required)>' 
     from bin/rails:4:in `require' 
     from bin/rails:4:in `<main>' 

我試圖從堆棧溢出一些相關的解決方案,但他們沒有工作。

+0

您可以嘗試在C:驅動器上創建項目嗎? – Raphael

+0

請問您可以將鏈接添加到您嘗試過但無效的SO問題中? – arongka

回答

0

幾天前我也遇到過這個問題。我必須做的是從我的機器上刪除所有版本的RSpec,然後運行bundle install。這安裝了最新版本的RSpec,一切都很好。