sinatra Questions

3

Solved

I'm building a simple app in ruby using the Sinatra framework. It's mainly "get" based - most requests will be for listing data. However there are a couple of key screens in the app that will colle...
Eustasius asked 12/7, 2012 at 11:47

9

I'm trying to build an rspec test that sends JSON (or XML) via POST. However, I can't seem to actually get it working: json = {.... data ....}.to_json post '/model1.json',json,{'CONTENT_TYPE'=&g...
Bachelorism asked 27/10, 2010 at 19:9

8

Let's say an application has really specific data which belongs to a user, and nobody is supposed to see it except the owner. I use MySQL database with DataMapper ORM mapper. The application is wri...
Luehrmann asked 8/12, 2009 at 16:56

4

Solved

I'm trying to test for a redirect on the homepage in my sinatra app (more specifically, a padrino app), in rspec. I've found redirect_to, however it seems to be in rspec-rails only. How do you test...
Hypnosis asked 15/9, 2011 at 0:4

4

I have no idea how to test my Sinatra application. Do I just run ruby That does not seem to work. All files out there only talk about how to write the contents of the file, but not about how to...
Freeman asked 13/1, 2010 at 10:27

4

Solved

Is there a way to override the sinatra default NotFound error page ("Sinatra doesnt know this ditty")? I want sinatra to show only a plain string as "Method not found" when it does not found the pr...
Hokusai asked 9/12, 2011 at 22:2

19

this question is for Windows I tried installing the gem 'sinatra-websocket', but when I ran gem install sinatra-websocket, I got this error... ERROR: Failed to build gem native extension ... along ...
Asthenopia asked 4/1, 2015 at 17:42

4

Solved

On server-side using Sinatra with a stream block. get '/stream', :provides => 'text/event-stream' do stream :keep_open do |out| connections << out out.callback { connections.delete(out...
Teletype asked 2/12, 2012 at 19:12

3

I'm new to Ruby Sinatra, I tried to build a simple web application with Sinatra with the following code: require 'rubygems' require 'sinatra' get '/firstapp' do "Welcome to my first Sinatra ...
Overcritical asked 20/5, 2021 at 7:25

10

Solved

I have a Sinatra server that is returning multiple JSON objects from the database in a streaming manner. The objects would look like: {"a": 1, "b": 2, "c": 3} {"a": 4, "b": 5, "c": 6} ... but th...
Digitiform asked 17/11, 2010 at 21:53

6

Solved

enable :sessions set :session_secret, 'secret' post '/login' do session[:loggedInUser] = jsondata['username'].to_s puts session[:loggedInUser] + " is the session" end Everything is good at thi...
Breana asked 17/9, 2013 at 8:26

5

Solved

In Sinatra, I'm unable to create global variables which are assigned values only once in the application lifetime. Am I missing something? My simplified code looks like this: require 'rubygems' if...
Acevedo asked 24/12, 2010 at 9:43

2

Solved

I have a Sinatra app that I run as a daemon, using Apache port-forwarding to mediate between port 80 and port 7655. This has been working fine in the past. Today, not so well. I cannot figure out w...
Regalado asked 30/9, 2012 at 14:22

2

Solved

I am trying to write a Sinatra application that groups components together (sort of like controllers). So for the "blog" related things, I want an app called Blog mounted at /blog. All of the route...
Tabling asked 16/7, 2012 at 0:19

6

Solved

As the title says, Google doesn't give anything useful concerning this. How do I set up and configure HTTPS/SSL for Sinatra apps? How do I create a HTTPS route? I have never used HTTPS for my ap...
Alternately asked 12/9, 2010 at 20:47

2

Solved

I am trying to connect my Sinatra app to PostgreSQL database with this tutorial: http://samuelstern.wordpress.com/2012/11/28/making-a-simple-database-driven-website-with-sinatra-and-heroku/. Everyt...
Eliezer asked 22/9, 2014 at 13:2

5

Solved

So, I want to have completely custom logging for my sinatra application, but I can't seem to disable the Rack::CommonLogger. As per the sinatra docs all I should need to do is add the following l...
Brookbrooke asked 6/3, 2014 at 8:57

5

Solved

I am busy porting a very small web app from ASP.NET MVC 2 to Ruby/Sinatra. In the MVC app, FormsAuthentication.SetAuthCookie was being used to set a persistent cookie when the users login was vali...
Evita asked 24/8, 2010 at 18:38

4

Solved

I'm getting this OmniAuth::Strategies::OAuth2::CallbackError at /auth/google/callback csrf_detected | CSRF detected My code: require 'sinatra' require "sinatra/json" require "sinatra/config_...
Hasseman asked 13/3, 2014 at 17:19

2

Solved

-----> Ruby/Rack app detected -----> Using Ruby version: ruby-1.9.3 -----> Installing dependencies using Bundler version 1.3.0.pre.2 Running: bundle install --without development:test --path vend...
Pycno asked 8/1, 2013 at 15:44

4

Solved

I have a REST service that's reasonably complete and will be used with an iOS app. It's built using Ruby/Sinatra but I don't think that really matters here. I'm using HTTP Basic Authentication ove...
Honeywell asked 20/1, 2012 at 19:17

3

Solved

I have a simple sinatra application that needs to generate a file (via an external process), send that file to the browser, and finally, delete the file from the filesystem. Something along these l...
Quackenbush asked 10/5, 2010 at 20:5

2

I am working on a Sinatra Project and have set some variables in the session for later usage. The scenario for which I need help for is that I want to access the session object in a middleware cla...
Sideswipe asked 2/2, 2012 at 13:29

10

I've just made the switch from rvm to rbenv and I'm trying to use bundler for gem management. After running bundle install and trying to run a simple sinatra app (ruby app.rb), I get this: Could n...
Khano asked 7/3, 2012 at 13:56

5

Solved

I have lot of helpers in my main Sinatra project_name.rb and I want to remove them to the external file, what is the best practice to do that ? from ./preject_name.rb helpers do ...#bunch of he...
Daryldaryle asked 2/8, 2011 at 18:16

© 2022 - 2025 — McMap. All rights reserved.