Sinatra 很新,但我正在按照本教程设置一个带有一些静态页面的简单博客站点:http: //danneu.com/posts/15-a-simple-blog-with-sinatra-and-active-record -一些有用的工具/
我创建了包含以下内容的 gemfile:
# Gemfile
source :rubygems
gem "sinatra"
gem "sqlite3"
gem "activerecord"
gem "sinatra-activerecord"
group :development do
gem "shotgun"
gem "tux"
end
然后我安装使用bundle install
我的 config.ru 看起来像这样:
#config.ru
require "./app"
run Sinatra::Application
但是当我尝试运行时tux
,出现以下错误:
/Users/admin/.rvm/gems/ruby-2.0.0-p195/gems/ripl-rack-0.2.0/lib/ripl/rack.rb:38:in `eval': cannot load such file -- ./app (LoadError)
from (eval):2:in `block in initialize'
from /Users/admin/.rvm/gems/ruby-2.0.0-p195/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
from /Users/admin/.rvm/gems/ruby-2.0.0-p195/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
from (eval):1:in `new'
from (eval):1:in `initialize'
from /Users/admin/.rvm/gems/ruby-2.0.0-p195/gems/ripl-rack-0.2.0/lib/ripl/rack.rb:38:in `eval'
from /Users/admin/.rvm/gems/ruby-2.0.0-p195/gems/ripl-rack-0.2.0/lib/ripl/rack.rb:38:in `initialize'
from /Users/admin/.rvm/gems/ruby-2.0.0-p195/gems/ripl-rack-0.2.0/lib/ripl/rack.rb:18:in `new'
from /Users/admin/.rvm/gems/ruby-2.0.0-p195/gems/ripl-rack-0.2.0/lib/ripl/rack.rb:18:in `rack'
from /Users/admin/.rvm/gems/ruby-2.0.0-p195/gems/ripl-rack-0.2.0/lib/ripl/rack.rb:9:in `before_loop'
from /Users/admin/.rvm/gems/ruby-2.0.0-p195/gems/ripl-multi_line-0.3.1/lib/ripl/multi_line.rb:18:in `before_loop'
from /Users/admin/.rvm/gems/ruby-2.0.0-p195/gems/ripl-0.7.0/lib/ripl/readline.rb:6:in `before_loop'
from /Users/admin/.rvm/gems/ruby-2.0.0-p195/gems/ripl-0.7.0/lib/ripl/completion.rb:5:in `before_loop'
from /Users/admin/.rvm/gems/ruby-2.0.0-p195/gems/ripl-0.7.0/lib/ripl/shell.rb:34:in `loop'
from /Users/admin/.rvm/gems/ruby-2.0.0-p195/gems/ripl-0.7.0/lib/ripl/runner.rb:49:in `start'
from /Users/admin/.rvm/gems/ruby-2.0.0-p195/gems/ripl-0.7.0/lib/ripl/runner.rb:31:in `run'
from /Users/admin/.rvm/gems/ruby-2.0.0-p195/gems/tux-0.3.0/bin/tux:7:in `<top (required)>'
from /Users/admin/.rvm/gems/ruby-2.0.0-p195/bin/tux:23:in `load'
from /Users/admin/.rvm/gems/ruby-2.0.0-p195/bin/tux:23:in `<main>'
from /Users/admin/.rvm/gems/ruby-2.0.0-p195/bin/ruby_noexec_wrapper:14:in `eval'
from /Users/admin/.rvm/gems/ruby-2.0.0-p195/bin/ruby_noexec_wrapper:14:in `<main>'
知道是什么原因造成的吗?我有ruby 2.0.0p195 (2013-05-14 revision 40734) [x86_64-darwin12.4.0]