0

I'm building a basic Ruby app with Sinatra and SendGrid.

When I try and run the file ruby app.rb the site does not load. When I remove require 'sendgrid-ruby' the app loads. Code below.

app.rb

require "sendgrid-ruby"
require "sinatra"
set :app_file, __FILE__

get '/' do
  puts "hi"
end

Gemfile

gem 'sinatra'
gem 'sendgrid-ruby'

Any help? I don't have a config.ru or anything else at this point. No error logging. It just hangs at waiting for LocalHost.

== Sinatra (v1.4.7) has taken the stage on 4567
for development with backup from Thin
Thin web server (v1.6.4 codename Gob Bluth)
Maximum connections set to 1024
Listening on localhost:4567, CTRL+C to stop

Ruby version: ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin15]

EDIT: Previously, I had require "sinatra" first and I didn't have set :app_file, __FILE__ in there at all.

troxwalt
  • 405
  • 4
  • 11
  • Is this the exact app that you're having difficulties with? Or is this just a very simplified example? – cozyconemotel Feb 13 '16 at 06:13
  • This is a very simplified example. Started a new test app to see if I would get the same behavior which I unfortunately did. And this is that code. – troxwalt Feb 13 '16 at 06:30
  • hmm then `puts "hi"` wouldn't show anything to the browser but that's not the real problem right? Can't reproduce your problem with `ruby 2.2.3p173`, `sinatra 1.4.7` and `thin 1.6.4`.. – cozyconemotel Feb 13 '16 at 07:12
  • This is so odd. Really not sure what's happening. Thanks for taking the time cozy. – troxwalt Feb 13 '16 at 16:39

0 Answers0