mdub / sham_rack

run Rack applications in-process, without a server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rails 5 error

marceloboeira opened this issue · comments

commented

Using ShamRack with Rails 5 generates a weird error:
LoadError: cannot load such file -- rack/showexceptions

Searching for it I found that the problem is the Sinatra version vs Rails version.*

Temporary Solution -> Add gem "sinatra", "2.0.0.beta2" to the gemfile.

However, it would be nice to resolve this dependency in the ShamRack's gemfile

References:

Hi Marcel.

Yeah, I'm aware there are some issues around Sinatra vs Rack v2. But, how do you imagine sham_rack resolving the conflict? That is, what kind of constraint do you propose adding to the gemspec?

It kind of feels like this shouldn't be ShamRack's problem. I'm reluctant to be specific about rack version - I'd rather make it compatible with as many versions of Rack as possible.

commented

I was thinking about it now, since ShamRack is not declaring any other dependency other than "rack" and it does not specify the version I am inclined to agree. But I would like to keep the issue open or create a warning at the README so others can easily find a solution to that problem, at least while sinatra is beta. WDYT?

I'm happy to discuss solutions in this thread. I'm going to mark it closed, though - I don't think it makes it any less findable.

ShamRack's gemspec makes no mention of Sinatra, so that's not the source of the conflict. Is something else pulling sinatra into your project?

I think the real "fix" is waiting for the release of Sinatra 2.0.0, bringing compatibility with Rack 2.0, and Rails 5. It looks like the Sinatra folks are getting close to a 2.0.0 release.

In the meantime, I reckon

gem "sinatra", ">= 2.0.0.beta"

is a fine workaround.