os: linux debian wheezy
rails version: 3.2.0
i want configure rspec work rails.
i'm using instruction: https://github.com/rspec/rspec-rails ('installation' section).
when try:
rails generate rspec:install
after performing things described in manual before,
get:
usage: rails new app_path [options]
etc.
how resolve this?
imho relevant part of gemfile:
gem 'rails', '3.2.0' group :development, :test gem 'sqlite3', '1.3.5' gem 'rspec-rails', '~> 2.0' end
(i'm new rails , using m. hartl manual learn.)
(what have tried already:
- changing rails version (4.0.0, 3.2.0);
- changing rspec version (initially 2.8.0, ~> 2.0);
- a few times 'bundle update', 'bundle install' , 'bundle update rspec-rails';
- installing 'rspec' , 'rspec-rails' using 'gem install';
this because when install gem install rails
after june 25, 2013 - install rails 4. when following course, hartl asks copy gemfile located in github repo refers rails '3.2.14'.
to solve problem, create gemset using rvm.
rvm gemset create sample_app rvm gemset use sample_app
then create gemfile inside empty folder.
mkdir sample touch gemfile
copy content form hartl's (gemfile)[https://raw.github.com/railstutorial/sample_app_2nd_ed/master/gemfile] gemfile created , run,
bundle install
once gems installed, go outside folder , delete it.
cd .. && rm -rf sample
now create new rails project , skip auto bundle install.
rails new sample --skip-unit-test --skip-bundle
once rails generated files, go inside folder , replace gemfile contents again hart's gemfile.
now run bundle install
finally can create rvm file automatically switch project gemset.
rvm --create --ruby-version use ruby-2.0.0@sample-app
ruby-2.0.0
refers system's active ruby version. you'll need replace accordingly.
this should work fine. let me know if have further help.
cheers!
Comments
Post a Comment