Questions tagged [sinatra]

Sinatra is a Domain Specific Language (DSL) for quickly creating web applications in Ruby with minimal effort. It is an alternative to other Ruby web application frameworks such as Ruby on Rails, Nitro, Camping, and Rango.

Filter by
Sorted by
Tagged with
0 votes
0 answers
28 views

ruby OmniAuth with Microsoft (Azure Active Directory) [closed]

I'm try to implement OmniAuth authentication for Azure in my Sinatra app. I've found omniauth-azure-activedirectory-v2 gem and an example of implementation on this post. The code is for Rails ...
Marco Gallo's user avatar
0 votes
1 answer
44 views

nginx passenger recv() failed (104: Connection reset by peer) while sending to client

I'm posting some json to a Sinatra post route on nginx. I'm getting a 500 ISE error. I don't know why this is happening. The JSON is good, the url is valid (showing 404 when pulled up in a browser, ...
Rich_F's user avatar
  • 1,826
0 votes
0 answers
72 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 ...
bjorn's user avatar
  • 175
0 votes
0 answers
26 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 ...
user3286042's user avatar
0 votes
0 answers
23 views

Fail to install puma on Mac OX 13.4.1, receiving error message: Failed to build gem native extension

I have Ruby 3.2.2, and Sinatra installed. When I tried to install puma, I kept getting the following ERROR message: Building native extensions. This could take a while... ERROR: Error installing puma:...
Terry's user avatar
  • 11
0 votes
0 answers
17 views

How to read Sinatra session data from server side redirect

I have a Caddy server with Sinatra app (app.domain.com) and second app (example.app.domain.com), both behind reverse proxies under a single domain. I want to authorize user with Sinatra before they ...
Patryk's user avatar
  • 7
0 votes
1 answer
58 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 ...
fooBar's user avatar
  • 412
0 votes
0 answers
53 views

set access token and refresh token in the header before redirect in sinatra app

I have a ruby sinatra app with a login endpoint. it will receive username and password params, as well as a redirect_url param, and after a successful authentication, it redirects to the redirect_url ...
shahram kalantari's user avatar
1 vote
0 answers
38 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: ...
pixeline's user avatar
  • 17.7k
0 votes
1 answer
31 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 ...
Evan Appleby's user avatar
1 vote
0 answers
82 views

How do I fix this migration error message in Ruby(Sinatra)

I'm new to programming in ruby, started using Sinatra framework and while trying to develop a simple MVC application I tried to create a migration on my Terminal but I'm getting these error messages ...
Amazing's user avatar
  • 11
0 votes
1 answer
107 views

Responsive dropdown menu in CSS

I'm trying to implement a dropdown menu in CSS. It's pretty much done, but I need the items which are below the dropdown to move down so there's room for the dropdown items. And when I close the ...
Juani Villanueva's user avatar
0 votes
1 answer
55 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 ...
Alfredo Gallegos's user avatar
0 votes
1 answer
27 views

Preventing broken object composition in REST

I have a Sinatra app with a Project model and a Task model, and a project has_many tasks. It's a composition type of relationship, meaning a project cannot exist without tasks associated. I create a ...
fullstackplus's user avatar
0 votes
0 answers
48 views

Sinatra Double Request Issue

I'm witnessing an issue where a Sinatra page is loading twice. I have a session secret string that's generated and output to the console error.log which is where I'm finding it's happening twice. get ...
Rich_F's user avatar
  • 1,826
0 votes
1 answer
49 views

Authentication problem in Ruby Sinatra web app

I have a simple Sinatra app with two controllers and api helper # ApplicationController class ApplicationController < Sinatra::Base register Sinatra::ActiveRecordExtension helpers ApiHelper ...
jedi's user avatar
  • 2,003
0 votes
0 answers
28 views

doesn't create table after migration creating in sinatra activerecord

After run rake db:migration I do rake db:migrate, but I don't see in console 'create table...' and when I run sqlite3 .tables , I don't see table I don't know how to solve this problem. I tried ...
Vladimir Lozitskiy's user avatar
0 votes
0 answers
16 views

Schema for Online Store? (ActiveRecord, React)

Right now, I am trying to create a short simple online store using ActiveRecord and React (not using Rails at the moment). My set up is this: a user clicks on the item which adds it to the cart. ...
taram414's user avatar
0 votes
0 answers
108 views

<strong>bundler: failed to load command: puma</strong>---Happened after gem update

The application is working well but puma is crashing when a postgres database connection is created...This was working well before updating my gem list now using puma ~6.0.2 Puma starting in single ...
Japheth Mwangi's user avatar
1 vote
0 answers
195 views

Ruby: Bundler's Mustermann `initialize` wrong number of arguments (given 2, expected 1) (ArgumentError)

I am following the steps of a GitHub tutorial on setting up a dev environment to create a GitHub app. Unfortunately, I'm stuck on Step 6 of the tutorial, as when I enter bundle exec ruby ...
Bogs's user avatar
  • 49
1 vote
0 answers
53 views

CSS styles do not apply correctly on deployed Sinatra app on fly.io

I have a Sinatra app that is minimally styled using Bootstrap and CSS. Here is a snippet of the head section with the two CSS links <head> <meta charset="utf-8"> <meta ...
Ben's user avatar
  • 139
0 votes
1 answer
72 views

How do I configure nginx to serve my Sinatra app instead of default page?

I am trying to get a Sinatra app running on a Digital Ocean droplet. I have started the Sinatra app running in var/www/myapp.com. I have confirmed thin is running with pgrep -l -f thin. When I ...
user3574603's user avatar
  • 3,364
0 votes
1 answer
42 views

how should I test whether a route has params in Sinatra?

In a Sinatra app, I have many routes that use a date. They are all formatted: get '/foo/:bar/:year/:month' do # code end I want to create a before hook setting a requested date according to the ...
thiebo's user avatar
  • 1,339
1 vote
1 answer
26 views

implementing multiple asynchrone operations in ruby

I have an API built with Sinatra. When a user logs in, the application checks the login and password and sends a jwt_refresh_token in a cookie to the client allowing the user to remain logged in. I'm ...
thiebo's user avatar
  • 1,339
0 votes
1 answer
23 views

How to copy dependant: :destroy variables of one object to another object in Mongoid?

A User class has many devices and deleted_devices. Relationships of User Class: has_many :devices, class_name: "Device", validate: false, autosave: true, dependent: :destroy ...
Hermione's user avatar
0 votes
1 answer
83 views

Sinatra app in Docker failing to execute 'mysql'?

This is my first real foray into Docker, and I'm a bit stuck at getting MySQL to play nicely with my app and I'm out of ideas on the why. I'm running the ruby:2.7.6 docker image which uses Debian. I'm ...
nolyoly's user avatar
  • 116
0 votes
0 answers
22 views

FrozenError - can't modify frozen Array - Error when trying to run brand new Padrino project [duplicate]

I created a new Padrino project with padrino generate project hello-padrino. When I attempt to run it with bundle exec padrino start I get the following error: ERROR - FrozenError - can't modify ...
EJ_'s user avatar
  • 65
1 vote
0 answers
44 views

Searching for solution to dynamically create endpoints in ruby sinatra by reading a file without restarting the web server

Trying to develop a framework to read from a file in text or json format for request and response and create dynamic endpoints to using ruby Sintra. Using web server as Puma for the web app deployment ...
Anupam Satsangi's user avatar
0 votes
1 answer
46 views

Sinatra LoadError: Error loading the 'sqlite3' Active Record adapter

Hello i'm trying to push a sinatra repo to dokku but every time come out this error rake aborted! LoadError: Error loading the 'sqlite3' Active Record adapter. Missing a gem it depends on? sqlite3 is ...
jjplack's user avatar
  • 113
0 votes
1 answer
253 views

How to deploy Ruby (Sinatra Framework) using Apache with Puma on Ubuntu?

I am running an Ubuntu 22.04 server on Linode and trying to deploy a simple Sinatra app using Apache with Puma, but currently, I am only able to display the index page, so I believe I am missing a ...
Evan Appleby's user avatar
0 votes
0 answers
36 views

I am trying to run a ruby sinatra app and I'm getting this error while running config.ru: cannot load such file -- matrix (LoadError)

This is the error I'm getting, please tell me what should I do? C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/prawn-2.4.0/lib/prawn/transformation_stack.rb:10:in `require': cannot load such file -- matrix (...
Ayushman Bedi's user avatar
0 votes
0 answers
54 views

Flash for Sinatra

What’s the best way to go about using flash in Sinatra? Similar to how Rails or Flask handle flash. The Sinatra docs suggest this gem, rack-flash for flash. I also came across this gem, sinatra-flash ...
Petesta's user avatar
  • 1,623
1 vote
1 answer
696 views

Can't modify frozen Array.(FrozenError)

When I start server with padrino start, this error happens: C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/padrino-core-0.15.1/lib/padrino-core/application.rb:32:in `concat': can't modify frozen Array: [/\\/...
aaaa's user avatar
  • 73
0 votes
0 answers
36 views

How use sessions with Whats app cloud api?

Need to build chat bot with whatsapp, so i use Whats app cloud api + Sinatrarb. When i need to send the session its sends perfectually, but its doesnt work class WhatsAppSender < Sinatra::Base ...
user3089327's user avatar
0 votes
0 answers
294 views

Running cron job on localhost using Whenever gem

Currently I have a Ruby and Sinatra project in which I am trying to automate a task. I have followed all the installation steps for the Whenever gem and written a function in my schedule.rb file that ...
sunlit_crow's user avatar
1 vote
0 answers
88 views

unable to rake db:migrate

everyone one I am working on a Sinatra app. I am trying to use Active Record as my database option. This is my first time of using Active Record with Sinatra. I have successfully created my table, ...
Adesuyi Fisola's user avatar
0 votes
0 answers
13 views

Want to get data from form post request using post endpoint [duplicate]

I have a simple form in html where i want to get the name of a user and post the name to the same url. My html file looks as so <!doctype html> <html> <head> <title>Edit ...
Korokus's user avatar
0 votes
0 answers
59 views

Error when attempting to migrate to postgres database on Heroku from Sinatra app

I have deployed my Sinatra application to Heroku. I have a sqlite database but since Heroku requires postgres, I needed to change this. To do this I setup a Postgres database on Heroku and specified ...
Pam's user avatar
  • 11
0 votes
1 answer
45 views

Is there a string length limit in heroku when inserting data into a postgresql active records database in ruby?

I am currently running into a problem where on my local machine, I can create and insert a record into a table called Devices but on my heroku deploy, I cannot create a record if the length of my ...
Korokus's user avatar
0 votes
1 answer
49 views

How can I use ActionMailer previews in a Sinatra app?

I have a Sinatra Ruby app with the ActionMailer gem for sending emails. The email sending functionality works fine, but I can't figure out how to use the preview functionality for development. My ...
NJRBailey's user avatar
0 votes
1 answer
72 views

Heroku deployment for Ruby / Sinatra / Postgres app "PG::ConnectionBad"

I’ve deployed my Ruby app on Heroku, however when looking to register or login I’m having an internal server error. My app is built on Sinatra and Rake. When doing heroku logs -tail I’m having the ...
Laura Kebab's user avatar
0 votes
1 answer
154 views

Is Karafka compatible with applications other than Rails? i.e Sinatra

I have a service that publishes a Kafka event whenever a user attribute is updated, now to consume and process this event I have a gem that uses Karafa. Every application that boots the gem will be ...
Ushay's user avatar
  • 3
-1 votes
1 answer
41 views

How I can use param in url without creating table in database

I have a controller that works without a table in the database. At the moment, there is an action index that performs a request to the api from which it performs the action. Route looks like /...
Danil Kravchenko's user avatar
1 vote
1 answer
89 views

How to create an ActiveRecord nested hash in the backend?

I have 4 Classes (Song, Review, Artist, and Genre). I'm displaying, on my frontend, a display of songs where each song gets a card. That card displays the reviews for that song, as well as displaying ...
Maj Aliju's user avatar
0 votes
1 answer
73 views

Turning off log rotation with ruby logging gem

I have some code I am maintaining that is using the logging ruby gem. I would like to use the linux logrotate tool instead of the gem to rotate the logs. I'm using it inside some custom code to ...
Julien Lamarche's user avatar
0 votes
1 answer
111 views

Passing array of values in Sinatra GET in a less verbose way

I know Sinatra is not super concise when it comes to this topic. To pass an array of values to a GET controller through query string I'd have to do: curl -v -H 'ContentType: application/json' -H '...
Tarta's user avatar
  • 1,739
-1 votes
1 answer
37 views

no such column: COLIN (SQLite3::SQLException)

My code is giving me the no such column error on my update function. It's returning the right output but still giving an error. I'm just want the update function to modify the first name when ran. Any ...
Colin Jackson's user avatar
0 votes
1 answer
105 views

How to serve yaml file with sinatra? (not download)

I have a basic Sinatra app, I'd like to serve a yaml file so that it can be read by a gem via http. I'm just able to download it: get '/download' do send_file './en.yml', :filename => 'en.yml', :...
AlbertMunichMar's user avatar
0 votes
1 answer
126 views

Puma failing because request headers are `nil`, but they are present in `env`

Two applications, one using Puma 4.3.4 and one using Puma 5.6.4, have both started failing with the same error: Read error: #<NoMethodError: undefined method `each' for nil:NilClass> Puma 5.6.4 ...
Leo's user avatar
  • 4,247
0 votes
0 answers
109 views

Is there a way to store required libraries persistently? I'm running into error code H10

Im deploying a sinatra webapp that makes use of a c library, through Ruby FFI. I need this library to be compiled on the target machine. I do this through a Rakefile normally, but because of Heroku's ...
Parker McGowan's user avatar

1
2 3 4 5
108