Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can we define the environment for mounted rails apps #207

Closed
AJFaraday opened this issue Mar 19, 2020 · 3 comments
Closed

How can we define the environment for mounted rails apps #207

AJFaraday opened this issue Mar 19, 2020 · 3 comments

Comments

@AJFaraday
Copy link

Sorry if this is the wrong place to ask this, but I can't find any documentation about it.

I'm mounting an app with the HTTPI Rack adapter:

::HTTPI.adapter = :rack
::HTTPI::Adapter::Rack.mount 'app', ::MyApp::Application

However, it's starting up in development mode, which may be the root of a problem.

I've tried a few different approaches to set the environment before mounting

`export RAILS_ENV=production`
Rails.env = 'production'
Rails.env = 'PRODUCTION'

None of these seem to have worked so far.

@rogerleite
Copy link
Member

Hi @AJFaraday

The short answer is I don't know how to set the environment for your case. The only documentation this adapter has is the PR that implemented: #75.

What's your root problem? What do you want to do with this?
The idea of this adapter is using to test only I think.

Hope that helps.

@AJFaraday
Copy link
Author

AJFaraday commented Mar 19, 2020

@rogerleite The issue is occurring in testing, when a value in one of the arguments contains a % symbol.

/home/biorails/.rvm/rubies/ruby-2.2.10/lib/ruby/2.2.0/uri/common.rb:382:in `decode_www_form_component': invalid %-encoding ("1.0" encoding="ISO-8859-1"?><en

It doesn't seem to be reaching the controller, the call doesn't hit the logs.

It's fine when I pass the exact XML to a production server there's no error.


The environment was the only difference I could see.

@pcai
Copy link
Member

pcai commented Jul 6, 2024

@AJFaraday sorry - I think you'll have better luck trying to ask this in a rails-specific forum. The rack adapter is very simple and doesn't really have any configuration options

@pcai pcai closed this as completed Jul 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants