代码是直接从 github 下过来解压然后 bundle install 发现 rails s 后能正常运行 但是测试就是各种出现错误 bundle exec rspec spec/requests/user_pages_spec.rb -e "signup page" 执行这句的时候出现:
bundle exec rspec spec/requests/user_pages_spec.rb -e "signup page"
No DRb server is running. Running in local process instead ...
/Library/Ruby/Gems/2.0.0/gems/rspec-core-2.13.0/lib/rspec/core/configuration.rb:819:in load': /Users/qianyuhui/Desktop/ruby/rails/sample_app_rails_4-modeling-users/spec/requests/user_pages_spec.rb:20: syntax error, unexpected tSTRING_BEG, expecting keyword_do or '{' or '(' (SyntaxError)
fill_in "Email",
^
/Users/qianyuhui/Desktop/ruby/rails/sample_app_rails_4-modeling-users/spec/requests/user_pages_spec.rb:20: syntax error, unexpected ',', expecting keyword_end
/Users/qianyuhui/Desktop/ruby/rails/sample_app_rails_4-modeling-users/spec/requests/user_pages_spec.rb:22: syntax error, unexpected tSTRING_BEG, expecting keyword_do or '{' or '('
fill_in "Confirmation", with: "foobar"
^
/Users/qianyuhui/Desktop/ruby/rails/sample_app_rails_4-modeling-users/spec/requests/user_pages_spec.rb:22: syntax error, unexpected ',', expecting keyword_end
fill_in "Confirmation", with: "foobar"
^
/Users/qianyuhui/Desktop/ruby/rails/sample_app_rails_4-modeling-users/spec/requests/user_pages_spec.rb:23: syntax error, unexpected ':', expecting keyword_end
with: "Example User"
^
/Users/qianyuhui/Desktop/ruby/rails/sample_app_rails_4-modeling-users/spec/requests/user_pages_spec.rb:24: syntax error, unexpected ':', expecting keyword_end
with: "[email protected]"
^
/Users/qianyuhui/Desktop/ruby/rails/sample_app_rails_4-modeling-users/spec/requests/user_pages_spec.rb:25: syntax error, unexpected ':', expecting keyword_end
with: "foobar"
^
from /Library/Ruby/Gems/2.0.0/gems/rspec-core-2.13.0/lib/rspec/core/configuration.rb:819:in
block in load_spec_files'
from /Library/Ruby/Gems/2.0.0/gems/rspec-core-2.13.0/lib/rspec/core/configuration.rb:819:in each'
from /Library/Ruby/Gems/2.0.0/gems/rspec-core-2.13.0/lib/rspec/core/configuration.rb:819:in
load_spec_files'
from /Library/Ruby/Gems/2.0.0/gems/rspec-core-2.13.0/lib/rspec/core/command_line.rb:22:in run'
from /Library/Ruby/Gems/2.0.0/gems/rspec-core-2.13.0/lib/rspec/core/runner.rb:77:in
rescue in run'
from /Library/Ruby/Gems/2.0.0/gems/rspec-core-2.13.0/lib/rspec/core/runner.rb:73:in run'
from /Library/Ruby/Gems/2.0.0/gems/rspec-core-2.13.0/lib/rspec/core/runner.rb:17:in
block in autorun'
google 了很久没发现答案。。求解惑