Install
gem install rspec-railsThis installs the following gems:
rspecrspec-corerspec-expectationsrspec-mocksrspec-railsConfigure:
Add
rspec-railsto the:testand:developmentgroups in the Gemfile:group :test, :development dogem "rspec-rails", "~> 2.4"endIt needs to be in the
:developmentgroup to expose generators and rake tasks without having to typeRAILS_ENV=test.Now you can run:
script/rails generate rspec:installThis adds the spec directory and some skeleton files, including the "rake spec" task.
Macintosh-2:gems wobbet$ jruby script/rails rspec:installError opening script file: /opt/local/jruby/lib/ruby/gems/1.8/gems/script/rails (No such file or directory)
On [Monday, January 24] at 5:50 AM, Robert Sanford wrote:
Running OS X Snow LeopardI installed JRuby to /opt/local/jrubyI put /opt/local/jruby/bin on my path ahead of /opt/local/bin which has my Ruby 1.8.7 installed via MacPorts (or is that the base install?).jruby gem install railsjruby gem install rspecjruby gem install rspec-railsAll of those work just fine and dandy. Now I get to the point in the instructions for installing rspec-rails (https://github.com/rspec/rspec-rails#readme) that says:
Install
gem install rspec-railsThis installs the following gems:
rspecrspec-corerspec-expectationsrspec-mocksrspec-railsConfigure:
Add
rspec-railsto the:testand:developmentgroups in the Gemfile:group :test, :development dogem "rspec-rails", "~> 2.4"endIt needs to be in the
:developmentgroup to expose generators and rake tasks without having to typeRAILS_ENV=test.Now you can run:
script/rails generate rspec:installThis adds the spec directory and some skeleton files, including the "rake spec" task.
Issue #1 - When it says "Add rspec-rails to the :test and :development groups in the Gemfile:" to which Gemfile is it referring? I'm assuming that it means rspec-rails and not one of the Gemfiles from the other gems (rspec, rspec-core, rspec-expectations, etc.) although it could mean the rspec gem but the "gem install" was for rspec-rails so I'm going with that one. Let me know if I'm wrong there please.
Issue #2 - When I run "which script" I get /usr/bin rather than in the JRuby directory so I'm a bit worried about that. Is "script" a generic command or is it a Ruby and/or Rails specific command and that indicates that I have either a path or installation problem?
Issue #3 - To be safe I run "jruby script/rails generate rspec:install" and I getMacintosh-2:gems wobbet$ jruby script/rails rspec:installError opening script file: /opt/local/jruby/lib/ruby/gems/1.8/gems/script/rails (No such file or directory)I'm hoping that means I'm not having an issue with my path by explicitly invoking jruby at the front although I'm not certain. Either way I have an error that I don't understand.