Beffa
Beffa

Reputation: 915

ruby 1.9, rvm, sinatra and rackup

Gemfile

source :rubygems
gem 'sinatra'

config.ru

require 'app'
run App

app.rb

require 'bundler/setup'
require 'sinatra'

class App < Sinatra::Base
  get '/' do
   'hello world'
  end
end

rackup failes with

.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': no such file to load -- app (LoadError)

Works with ruby 1.8 . Why?

Upvotes: 1

Views: 1261

Answers (2)

Steve
Steve

Reputation: 15736

I think it's because 1.9.2 no longer includes '.' in the load path by default.

See the this question for more: Why does Ruby 1.9.2 remove "." from LOAD_PATH, and what's the alternative?

Upvotes: 4

include
include

Reputation: 2118

Some notes:

Gemfile, I use gem 'sinatra', :require => 'sinatra/base' to load a Modular Sinatra App.

Config.ru, usually I set Bundler on it, not in app.rb, leaving app.rb clean to my app.

require 'bundler/setup' Bundler.require(:default)

Upvotes: 1

Related Questions