Running OS X Snow Leopard
I installed JRuby to /opt/local/jruby
I 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 rails
jruby gem install rspec
jruby gem install rspec-rails
All of those work just fine and dandy. Now I get to the point in the
instructions for installing rspec-rails (
GitHub - rspec/rspec-rails: RSpec for Rails 5+) that says:
Install
gem install rspec-rails
This installs the following gems:
rspec
rspec-core
rspec-expectations
rspec-mocks
rspec-rails
Configure:
Add rspec-rails to the :test and :development groups in the Gemfile:
group :test, :development do
gem “rspec-rails”, “~> 2.4”
end
It needs to be in the :development group to expose generators and rake
tasks without having to type RAILS_ENV=test.
Now you can run:
script/rails generate rspec:install
This 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 get
Macintosh-2:gems wobbet$ jruby script/rails rspec:install
Error 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.
Any help is appreciated.
Many thanks!!!
rjsjr