jejacks0n / teaspoon

Teaspoon: Javascript test runner for Rails. Use Selenium, BrowserStack, or PhantomJS.
1.43k stars 243 forks source link

Duplicate route named "teaspoon" #170

Closed pareeohnos closed 10 years ago

pareeohnos commented 10 years ago

I'm currently trying to migrate my project over to jRuby, and in the process got the latest version of teaspoon (0.7.9) in my jRuby gemset, but still had 0.7.8 in the standard ruby gemset. After trying to launch my app, I was given an error stating that the route named "teaspoon" already exists, and the app failed.

After having downgraded teaspoon back to 0.7.8 however, it seems to be working again. Not sure what changed to cause this?

jejacks0n commented 10 years ago

If both versions were being loaded it would cause this. The route is prepended in the engine to avoid any catch-all routes. Do you see a way to avoid this if both gems were being loaded? I assume this was the case. If you try upgrading to 0.7.9 in your current gemfile do you see the same issue?


Jeremy Jackson

On Jan 29, 2014, at 5:33 AM, pareeohnos notifications@github.com wrote:

I'm currently trying to migrate my project over to jRuby, and in the process got the latest version of teaspoon (0.7.9) in my jRuby gemset, but still had 0.7.8 in the standard ruby gemset. After trying to launch my app, I was given an error stating that the route named "teaspoon" already exists, and the app failed.

After having downgraded teaspoon back to 0.7.8 however, it seems to be working again. Not sure what changed to cause this?

— Reply to this email directly or view it on GitHub.

pareeohnos commented 10 years ago

hmm didn't think about it loading both. Assumed it'd replaced the old version when I switched, but still no joy. I've just done the following

gem uninstall teaspoon
    (removed version 0.7.8)
rails s
    (produced same error)
gem uninstall teaspoon
    (removed anything left)
bundle install
rails s
    (produced same error)

It seems to still be breaking even after having completely removed all versions of the gem and reinstalling. Dropping back down to 0.7.8 fixes it again.

jejacks0n commented 10 years ago

So you're saying you see the error when teaspoon is not installed?

pareeohnos commented 10 years ago

Not when it's uninstalled no, but after uninstalling entirely and reinstalling it still breaks. If I removed it I just get an error saying it's not installed (still in gemfile) which I expect. Then doing a bundle install causes it to give me the error unless I specified version 0.7.8

jejacks0n commented 10 years ago

ok, I'll look into it further. I was using it fine the other day, but I'll double check.

pareeohnos commented 10 years ago

Great thanks. Not sure if this happens when using just plain ol' ruby. I've switched over to jRuby and that's when I first noticed the problem, but the plain version of ruby was running on 0.7.8 so I can't be sure if it only broke because of the upgrade, or because it's now in jRuby

jejacks0n commented 10 years ago

Any updates?

pareeohnos commented 10 years ago

Nope, no progress on this, still running on 0.7.8

ddarren commented 10 years ago

I'm seeing the same route error when using the "rails generate teaspoon:install" generator in 0.7.9 in a jRuby Rails app.

jejacks0n commented 10 years ago

the 0.8 branch changes how things are loaded, but I'd be curious if this is resolved, or still lingering on that branch.

ddarren commented 10 years ago

I'm getting a similar but different error with the 0.8 branch:

ArgumentError: Invalid route name, already in use: 'teaspoon'
You may have defined two routes with the same name using the `:as` option, or you may be overriding a route already defined by a resource with the same naming. For the latter, you can restrict the routes created with `resources` as explained here:
http://guides.rubyonrails.org/routing.html#restricting-the-routes-created
                               add_route at /Users/dsmith/.rvm/gems/jruby-1.7.8@orchestrate/gems/actionpack-4.0.1/lib/action_dispatch/routing/route_set.rb:434
                               add_route at /Users/dsmith/.rvm/gems/jruby-1.7.8@orchestrate/gems/actionpack-4.0.1/lib/action_dispatch/routing/mapper.rb:1445
jejacks0n commented 10 years ago

0.8 should take this into account now, though it's still a larger concern.. if this doesn't work, I'd appreciate it if you wanted to hop into the gem on your end and see what does resolve it.

nathany commented 10 years ago

I see this error when switching from MRI to JRuby with teaspoon (0.7.9).

Using master doesn't have this issue. Is 0.8.0 near release?

jejacks0n commented 10 years ago

waiting to get feedback.. so this helps. =)

nathany commented 10 years ago

Oh, maybe a release candidate would be a good idea?

pareeohnos commented 10 years ago

Seems to be working without an error now on the 0.8-followup branch. I get a couple of deprecation warnings but this seems to be more to do with my configuration file so I'm assuming something else has changed, but the original issue seems to be resolved :)

Gonzih commented 10 years ago

On JRuby I'm getting this error on rails generate teaspoon:install command. Gem version is 0.8.0.

nowhereman commented 10 years ago

@Gonzih Same for me, on JRuby 1.7.12 with Rails 4.0.2, Teaspoon 0.7.9 and 0.8.0 said that all my routes are duplicated ... I need to stay on Teaspoon 0.7.8 for now

nowhereman commented 10 years ago

With Rails 4.0.5, this issue is gone.

jejacks0n commented 10 years ago

Yay! Thanks for the info @nowhereman. I was never able to track down why that was happening, so it's good to know it was just a regression in rails.