Could not find generator rspec:install.

后端 未结 11 669
一向
一向 2021-01-01 08:03

I\'m trying to follow this tutorial here: http://railstutorial.org/chapters/static-pages#top

When I run:

$ rails generate rspec:install

相关标签:
11条回答
  • 2021-01-01 08:59

    Try installing it as a gem.

    gem install rspec

    with rails 3 in your config/environment.rb you maintain gems there with bundle install but in terms of what your doing you can just gem install rspec.

    0 讨论(0)
  • 2021-01-01 09:01

    I realized that I had not saved after I updated my Gemfile. I simply saved, ran bundle install on the command line, and finally ran $ rails generate rspec:install

    0 讨论(0)
  • 2021-01-01 09:02

    I had do both gem install rspec and then add to gemfile as Andreas said.

    using Rails 3.2.1 and ruby 1.9.3 at windows 7 and worked perfectly.

    0 讨论(0)
  • 2021-01-01 09:02

    If you, like me, created a project, decided you wanted to archive the old directory and start again, but left spring running in the background on accident, spring won't reload from the correct directory and you'll be very confused.

    The solution is to stop spring and let it restart on its own.

    0 讨论(0)
  • 2021-01-01 09:10

    Remove all rspec versions by running the following commands as suggested by Sydney in another post and then install -V 2.0.1

    gem uninstall rspec
    gem uninstall rspec-core rspec-expectations rspec-mocks rspec-support
    gem install rspec -v 2.0.1
    

    add the following line to the gem file

    gem 'rspec-rails', '~> 2.0.0'
    

    and then run

    rails generate rspec:install
    

    it runs without any issues

    0 讨论(0)
提交回复
热议问题