Heroku App Fails to Start - 'Require': No Such File to Load -- Sinatratestapp (Loaderror)

Heroku app fails to start - `require': no such file to load -- sinatratestapp (LoadError)

By the help of Heroku support request and this question I found out the solution.

Ruby 1.9.2 doesn't automatically include "." in the $LOAD_PATH. To workaround this, modify config.ru by stating require './sinatratestapp' instead of require 'sinatratestapp'.

Rake tasks with Sinatra context on Heroku

It looks like the file where your settings are defined is not being loaded. In your config.ru change require 'my_sinatra_app' with require './my_sinatra_app' . Also see this question.

Heroku Aplication error with Google charts

Finally, I used

gem "googlecharts"

which works pretty well.

Why does Ruby 1.9.2 remove . from LOAD_PATH, and what's the alternative?

It was deemed a "security" risk.

You can get around it by using absolute paths

File.expand_path(__FILE__) et al

or doing

require './filename' (ironically).

or by using

require_relative 'filename'

or adding an "include" directory

ruby -I . ...

or the same, using irb;

$irb -I .

Hosts file on Heroku

Don't use the WSDL. Call the functions directly. Like this:


#!ruby

require 'savon'

stock_handle = ARGV[0] || 'OTEX'

client = Savon::Client.new do
wsdl.endpoint = 'http://www.webservicex.net/stockquote.asmx'
wsdl.namespace = 'http://www.webserviceX.NET/'
end

response = client.request :wsdl, 'GetQuote' do
http.headers["SOAPAction"] = '"http://www.webserviceX.NET/GetQuote"'
soap.body = { "symbol" => stock_handle }
end

print response

How to automatically remove trailing whitespace in Visual Studio 2008?

CodeMaid is a very popular Visual Studio extension and does this automatically along with other useful cleanups.

  • Download: https://github.com/codecadwallader/codemaid/releases/tag/v0.4.3
  • Modern Download: https://marketplace.visualstudio.com/items?itemName=SteveCadwallader.CodeMaid
  • Documentation: http://www.codemaid.net/documentation/#cleaning

I set it to clean up a file on save, which I believe is the default.



Related Topics



Leave a reply



Submit