I'm following the tutorial http://learnrubythehardway.org/book/ex50.html, which provides:
create the most basic Sinatra application possible. Put the following code into
bin/app.rb
:
require 'sinatra'
set :port, 8080
set :static, true
set :public_folder, "static"
set :views, "views"
get '/' do
return 'Hello world'
end
I installed gem and Sinatra without a problem. I also copied the app.rb
from the tutorial into my local bin/app.rb
file.
I ran it with: ruby bin/app.rb
The terminal outputs:
/home/t/.rbenv/versions/2.2.0/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in 'require': cannot load such file -- sinatra (LoadError)
from /home/t/.rbenv/versions/2.2.0/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in 'require'
from bin/app.rb:1:in `<main>
When I run rake test
it passes the test. What's the problem?