Questions tagged [sinatra]

0 votes
1 replies
PG::SyntaxError at /bookmarks - I'm unable to work out why the SQL query is wrong
When running my application using sinatra, I get the error message PG::SyntaxError at /bookmarks ERROR: syntax error at or near "{" LINE 1: SELEC...
asked 1 month ago
1 votes
1 replies
ruby/sinatra: will code outside the routes run only once or each time site is pinged?
I have a slim Sinatara site. If I include code outside the get routes, will it run in the background only once, or will it trigger each time the...
asked 1 month ago
0 votes
0 replies
How to search for all posts containing keyword using Sinatra and Datamapper?
I am fairly new to full stack development and I am trying to get a simple search form to work. The webpage is supposed to redirect the user to a...
asked 1 month ago
-2 votes
0 replies
Ruby + SQLite select condition
In my .rb file, here's what I got (it works): SELECT id, name, age, height FROM student WHERE age LIKE '%#{h params[:stu_age]}%' In words,...
asked 1 month ago
0 votes
1 replies
Use PORT environment variable in Rack/Sinatra
I'm looking to set the listening port within my Rack and Sinatra app, using the PORT environment variable if set otherwise to a default. I thoug...
asked 2 months ago
0 votes
0 replies
Ruby Sinatra streaming via Thin only works locally
I'm working on streaming plain text back to the client as outlined in http://sinatrarb.com/contrib/streaming.html. It works fine when I curl the...
0 votes
0 replies
Document Model Fields Sinatra
Is there some automated way to document fields names and types inside of the models in Sinatra app, something equivalent to annotate gem in rails...
asked 2 months ago
1 votes
0 replies
Sinatra Session Not Persisting On Post
I am currently running a sinatra app using puma and an nginx reverse proxy. Sessions and cookies persist fine on any get requests as seen by log...
asked 3 months ago
0 votes
0 replies
Heroku + Puma why is on_worker_boot being called many many times?
When I try to run my sinatra app with Puma I have a surprising result. I've written the puma.rb as recommended, and I put a puts into on_worker_b...
asked 2 months ago
0 votes
1 replies
What is 'use ClassName' in Ruby (vs include, require, load)
What does use SomeClassName do in Ruby? In the course of migrating a 'flat/classic' Sinatra app to use separate classes for each controller, I c...
asked 3 months ago
2 votes
3 replies
What is this file config.ru, and what is it for?
What is this file config.ru, and what is it for in Sinatra projects? In my lanyard of the project, such code is written: require './app' run Sin...
asked 3 months ago
1 votes
2 replies
How to create Sinatra app with page that reloads with new content not cache
I trying to create a fairly minimal example for templates and teaching. I create my app.rb file require 'sinatra' get '/' do "Minimal!__ !_!...
asked 2 months ago
0 votes
0 replies
How to mark a string as html safe in Sinatra 2 and Haml 5
Suppose in a thousand places in a a hundred views I want to use a hundred different methods, most of which return plain text, but some of which r...
asked 4 months ago
0 votes
2 replies
How to read data sent by HTTParty in Sinatra
I am trying to have two separate Ruby programs to communicate, one with the Sinatra gem, and another with the HTTParty gem. What I am attempting...
asked 3 months ago
0 votes
0 replies
Ruby app with Sinatra, Unicorn, and Mongodb
I've been tasked with building a simple app. I don't have any experience with Sinatra, Unicorn, or Mongo. I'm struggling with figuring out where...
asked 3 months ago
0 votes
0 replies
Exception while using Rack Session File
I am trying to use the Rack::Session::File in one of my Sinatra based ruby project but getting the following exception while trying to login. R...
asked 5 months ago
0 votes
1 replies
Sinatra::Reloader not reloading files in Docker container
I'm trying to setup a simple sinatra app in a Docker container. I've setup modular Sinatra app on rack with config.ru: require 'rubygems' requir...
asked 4 months ago
0 votes
0 replies
rails/roda/sinatra/… / normalize object keys
we often face irregularities from the object we can receive (stringified keys, or the opposite), so each specs, services, etc.. needs to handle i...
asked 4 months ago
1 votes
1 replies
undefined symbol: rmpd_util_str_to_d -
During working with gem 'tux' I receive the following error: 2: from /usr/local/lib/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:34:in `r...
0 votes
1 replies
Getting two errors for password presence in activerecord
I am testing my user input validation in my application and I am getting two errors in regards to my password presence. This is what I have writ...
asked 5 months ago
0 votes
2 replies
Before filter in Sinatra causing a redirect loop
I have this simple code: require 'sinatra' before do redirect '/login' end get '/login' do 'hello' end get '/test' do 'should not show...
asked 4 months ago
0 votes
1 replies
HTTP PUT request with Ruby Sinatra
I created a body for a PUT request with Ruby. When I print out the body, I don't see any problems. But when I try to print out the body from the...
asked 4 months ago
0 votes
1 replies
How to run cronjobs and rackup
My problem is when run cron and rackup service for ruby sinatra in docker. file cronjobs * * * * * cd /app && rake parser >> cron...
asked 4 months ago
1 votes
0 replies
MongoDB Geosptial Query with Distance in Ruby Route
I am trying to add a maxDistance filter to my collection query, but it will return nothing anytime I apply the filter. If I don't apply maxDistan...
0 votes
0 replies
Ruby Webrick server not able to verify client certificate
I am running a sinatra based web application using Webrick. I was able to setup TLS using my self-signed server certificates and webrick starts i...
asked 5 months ago