All Questions
4,214
questions
0
votes
0
answers
16
views
Issue with Psych::DisallowedClass Exception when using reify in PaperTrail with Sinatra
I am working on a Ruby project using Sinatra version 3.0.6 and Ruby version 3.0.0. I am using the PaperTrail gem (version 15.1.0) to track changes in my models for auditing and version control ...
1
vote
1
answer
111
views
How to use Rack::RewindableInput::Middleware in a Sinatra Ruby app?
This is the code that works just fine:
require 'sinatra'
post '/foo' do
"Equals to #{params[:a]}!"
end
If I send POST request, it returns all right:
$ ruby foo.rb -p 8888
$ curl -X POST -...
1
vote
1
answer
53
views
Cannot get request body from form in Sinatra
I have a form submission in Sinatra that's not showing any received params. Chrome is showing the form submission payload as proper, so the form is fine. It's just not making it through to Sinatra ...
0
votes
1
answer
42
views
Sinatra doesn't parse Slack interactive content payload
I'm trying to use Slack interactive content to send the response of a button into a Sinatra app but the body doesn't get de-serialized.
Whenever I try to use the Slack message button I receive this ...
0
votes
1
answer
110
views
How to pass an instance variable to a erb template in a Sinatra route? [closed]
How do I pass an instance variable to an erb template in a Sinatra route. The below doesn't work.
get '/' do
@beercompany = "Coors"
erb :mytemplate
end
mytemplate....
0
votes
1
answer
64
views
how to configure Sinatra to accept more option parameters?
I'm using Sinatra for a desktop app that runs on local host. When I start it up, I want to pass it an option like this ruby mysinatra.rb -first_name="My Name" However, I keep getting invalid ...
0
votes
0
answers
38
views
how to find missing indices in mysql using rspec? [duplicate]
I need to identify missing indices in mysql before deploy to production. For example, analyze rspec test.
My stack:
sinatra
sequel gem
mysql
It is preferable ORM-agnostic solution or for sequel ORM
...
3
votes
2
answers
397
views
Fixing DEPRECATION WARNING: Calling ActiveRecord::Base.clear_active_connections
I'm working on a Ruby Sinatra app with Active Record and it gets this error message printed in the console with every HTTP call.
I couldn't find anywhere more information about this deprecation or how ...
0
votes
0
answers
49
views
Overwrite rake tasks in sinatra project and activerecord
I have a Sinatra fun project and I want to improve my rake tasks so that everytime I create a new migration and migrate it I don't have to manually run them with RACK_ENV=test bundle exec rake db:...
0
votes
0
answers
102
views
Ruby/Sinatra - Cloudrun deploy passing '--source' option to ruby
I'm new to Cloudrun, attempting to deploy a Sinatra app. I've gone through the documentation, but can't figure out why '--source' keeps getting passed in. Haven't left it in the app itself, I figure ...
0
votes
0
answers
78
views
Application sent EOF before finishing response headers resulting in 502
We're running 2 Sinatra apps side-by-side on phusion passenger + nginx on an admittedly EOL version of ruby using the Docker image phusion/passenger-ruby27:2.5.0. We're using memcached-backed sessions ...
0
votes
1
answer
91
views
How to evaluate Ruby code in Haml as a varaible
I was playing with ruby evaluation in haml. It doesn't work if i pass a variable to the haml template. it only works if the ruby code is already inside the template (not passed as variable), I'm ...
1
vote
0
answers
43
views
Asian url redirection
I am trying to setup a redirection of URLs that contain Korean or Japanese characters to their English counterparts in a Sinatra application (ruby). Instead of a 301, I get a 404 response.
Example:
...
0
votes
1
answer
96
views
How to retrieve full referring URL in Sinatra?
My app is written in Ruby on a Sinatra framework. One of the functions in my app displays javascript code. That javascript code is called by remote websites. In Ruby, I need to know the full URL of ...
0
votes
1
answer
94
views
Sinatra On Kubernetes - Moved app to subdirectory, app assets fail to render in production (404) but work locally
My code: https://github.com/nullset2/smbdxfortunes
Hi. My setup is as follows:
Sinatra app
Ruby 2.7
Kubernetes 1.17
Traefik Ingress as "Reverse proxy"
I originally had this application ...