First of all, I’ve been trying to find an answer for this problem all
over the internet without luck.
The thing is that I am using RVM with ruby 1.9.2-head and I created a
new empty gemset. Then I installed bundler gem with:
gem bundler install
That installed the library into the /Users/damselem/.rvm/gems/
ruby-1.9.2-head@rails3/gems directory. Then I went to my rails 3 app
directory and I ran “bundle install” which showed this:
Everything seems perfect, but when running some route specs I got an
undefined method error for route_to method. I’ve checked in the github
repository and it actually exists. So I decided to look inside the
library but I couldn’t find the /rspec/rails/matchers/
routing_spec_matchers.rb directory and either the matchers directory.
So, my question is: Why is not the file in there? Why is not the
matchers directory either?
Then I found under /Users/damselem/.rvm/gems/ruby-1.9.2-head@rails3/ a
bundler directory with some gems, and with folder names like:
AccountsController Routes should route to new action with GET
Failure/Error: { :get => “/accounts/new” }.should
route_to(:controller => “accounts”, :action => “new”)
undefined method `route_to’ for
#RSpec::Core::ExampleGroup::Nested_1::Nested_1:0x000001088836c8
I got the same undefined method `route_to’ error with rspec-rails
v2.0.0.beta.12 and did not understand why …
Seems like this method has been added after the v2.0.0.beta.12 tag.
You’ll have to use the tip of the repo to get that working, until
v2.0.0.beta.13 or RC is out
Hmm… So what do you have in your gemfile? Just gem rspec-rails,
without the version? Do you know why there are some gems that are
installed in the bundler directory? Thank you very much !
Hmm… So what do you have in your gemfile? Just gem rspec-rails,
without the version? Do you know why there are some gems that are
installed in the bundler directory? Thank you very much !
That would make sense if I installed some gems via “gem install” and
other using “bundle install”, right? In my case I installed all gems
using bundler. Don’t know…
One of the problems could be that your routing specs is in the wrong
directory. Make sure all your routing specs go into ‘spec/routing’
directory. Hope that helps.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.