入门教程错误:未捕获抛出“无法为条目lib / index.rhtml提交目标sproutcore”

时间:2012-01-26 03:34:12

标签: sproutcore sproutcore-2

我正在使用Mac OS-X Lion,已经预装了Ruby on Rails 3.0并且正在使用Sproutcore的入门教程(http://sproutcore.com/guides/getting_started.html)。当我运行服务器并点击:http://localhost:4020/todos时。我的终端出现了以下错误:

   bash-3.2# sc-server 
    SproutCore v1.7.1.beta Development Server
    Allowing access only from IPs: 127.0.0.1. Use --allow-from-ips='*.*.*.*' to allow all
    Starting server at http://0.0.0.0:4020 in debug mode
    To quit sc-server, press Control-C
>> Thin web server (v1.2.11 codename Bat-Shit Crazy)
>> Maximum connections set to 1024
>> Listening on 0.0.0.0:4020, CTRL+C to stop
WARN 22:18:34.009 ~ Could not find target sproutcore/core_foundation that is required by /todos 
WARN 22:18:34.009 ~ Could not find target sproutcore/empty_theme that is required by /todos 
WARN 22:18:34.009 ~ Could not find target sproutcore/core_foundation that is required by /todos 
ArgumentError: uncaught throw "Cannot file target sproutcore for entry lib/index.rhtml"
    /usr/local/sproutcore/lib/sproutcore/models/manifest.rb:316:in `throw'
    /usr/local/sproutcore/lib/sproutcore/models/manifest.rb:316:in `entry_for'
    /usr/local/sproutcore/lib/sproutcore/builders/html.rb:55:in `layout_entry'
    /usr/local/sproutcore/lib/sproutcore/builders/html.rb:61:in `layout_path'
    /usr/local/sproutcore/lib/sproutcore/builders/html.rb:106:in `render'
    /usr/local/sproutcore/lib/sproutcore/builders/html.rb:122:in `build'
    /usr/local/sproutcore/lib/sproutcore/builders/base.rb:35:in `build'
    /usr/local/sproutcore/lib/buildtasks/build.rake:68:in `block (2 levels) in define!'
    /usr/local/sproutcore/lib/sproutcore/buildfile/task.rb:231:in `call'
    /usr/local/sproutcore/lib/sproutcore/buildfile/task.rb:231:in `block in execute'
    /usr/local/sproutcore/lib/sproutcore/buildfile/task.rb:226:in `each'
    /usr/local/sproutcore/lib/sproutcore/buildfile/task.rb:226:in `execute'
    /usr/local/sproutcore/lib/sproutcore/buildfile/task.rb:183:in `invoke_with_call_chain'
    /usr/local/sproutcore/lib/sproutcore/buildfile/task.rb:140:in `invoke'
    /usr/local/sproutcore/lib/sproutcore/buildfile.rb:214:in `invoke'
    /usr/local/sproutcore/lib/sproutcore/models/manifest_entry.rb:347:in `build_to'
    /usr/local/sproutcore/lib/sproutcore/models/manifest_entry.rb:259:in `build!'
    /usr/local/sproutcore/lib/sproutcore/rack/builder.rb:129:in `block (2 levels) in call'
    /usr/local/sproutcore/lib/sproutcore.rb:161:in `profile'
    /usr/local/sproutcore/lib/sproutcore/rack/builder.rb:128:in `block in call'
    <internal:prelude>:10:in `synchronize'
    /usr/local/sproutcore/lib/sproutcore/rack/builder.rb:89:in `call'
    /usr/local/sproutcore/bundle/ruby/1.9.1/gems/rack-1.4.0/lib/rack/cascade.rb:23:in `block in call'
    /usr/local/sproutcore/bundle/ruby/1.9.1/gems/rack-1.4.0/lib/rack/cascade.rb:22:in `each'
    /usr/local/sproutcore/bundle/ruby/1.9.1/gems/rack-1.4.0/lib/rack/cascade.rb:22:in `call'
    /usr/local/sproutcore/bundle/ruby/1.9.1/gems/rack-1.4.0/lib/rack/showexceptions.rb:24:in `call'
    /usr/local/sproutcore/bundle/ruby/1.9.1/gems/rack-1.4.0/lib/rack/recursive.rb:43:in `_call'
    /usr/local/sproutcore/bundle/ruby/1.9.1/gems/rack-1.4.0/lib/rack/recursive.rb:38:in `call'
    /usr/local/sproutcore/bundle/ruby/1.9.1/gems/rack-1.4.0/lib/rack/conditionalget.rb:25:in `call'
    /usr/local/sproutcore/lib/sproutcore/rack/restrict_ip.rb:59:in `call'
    /usr/local/sproutcore/lib/sproutcore/rack/service.rb:117:in `call'
    /usr/local/sproutcore/bundle/ruby/1.9.1/gems/thin-1.2.11/lib/thin/connection.rb:84:in `block in pre_process'
    /usr/local/sproutcore/bundle/ruby/1.9.1/gems/thin-1.2.11/lib/thin/connection.rb:82:in `catch'
    /usr/local/sproutcore/bundle/ruby/1.9.1/gems/thin-1.2.11/lib/thin/connection.rb:82:in `pre_process'
    /usr/local/sproutcore/bundle/ruby/1.9.1/gems/thin-1.2.11/lib/thin/connection.rb:57:in `process'
    /usr/local/sproutcore/bundle/ruby/1.9.1/gems/thin-1.2.11/lib/thin/connection.rb:42:in `receive_data'
    /usr/local/sproutcore/bundle/ruby/1.9.1/gems/eventmachine-1.0.0.beta.4/lib/eventmachine.rb:179:in `run_machine'
    /usr/local/sproutcore/bundle/ruby/1.9.1/gems/eventmachine-1.0.0.beta.4/lib/eventmachine.rb:179:in `run'
    /usr/local/sproutcore/bundle/ruby/1.9.1/gems/thin-1.2.11/lib/thin/backends/base.rb:61:in `start'
    /usr/local/sproutcore/bundle/ruby/1.9.1/gems/thin-1.2.11/lib/thin/server.rb:159:in `start'
    /usr/local/sproutcore/bundle/ruby/1.9.1/gems/rack-1.4.0/lib/rack/handler/thin.rb:13:in `run'
    /usr/local/sproutcore/lib/sproutcore/rack/service.rb:93:in `start'
    /usr/local/sproutcore/lib/sproutcore/tools/server.rb:65:in `server'
    /usr/local/sproutcore/bundle/ruby/1.9.1/gems/thor-0.14.6/lib/thor/task.rb:22:in `run'
    /usr/local/sproutcore/bundle/ruby/1.9.1/gems/thor-0.14.6/lib/thor/invocation.rb:118:in `invoke_task'
    /usr/local/sproutcore/bundle/ruby/1.9.1/gems/thor-0.14.6/lib/thor.rb:263:in `dispatch'
    /usr/local/sproutcore/bundle/ruby/1.9.1/gems/thor-0.14.6/lib/thor/base.rb:389:in `start'
    /usr/local/sproutcore/lib/sproutcore/tools.rb:452:in `start'
    /usr/local/sproutcore/lib/sproutcore/tools.rb:30:in `invoke'
    /usr/bin/sc-server:11:in `<main>'
ArgumentError: uncaught throw "Cannot file target sproutcore for entry lib/index.rhtml"
    /usr/local/sproutcore/lib/sproutcore/models/manifest.rb:316:in `throw'
    /usr/local/sproutcore/lib/sproutcore/models/manifest.rb:316:in `entry_for'
    /usr/local/sproutcore/lib/sproutcore/builders/html.rb:55:in `layout_entry'
    /usr/local/sproutcore/lib/sproutcore/builders/html.rb:61:in `layout_path'
    /usr/local/sproutcore/lib/sproutcore/builders/html.rb:106:in `render'
    /usr/local/sproutcore/lib/sproutcore/builders/html.rb:122:in `build'
    /usr/local/sproutcore/lib/sproutcore/builders/base.rb:35:in `build'
    /usr/local/sproutcore/lib/buildtasks/build.rake:68:in `block (2 levels) in define!'
    /usr/local/sproutcore/lib/sproutcore/buildfile/task.rb:231:in `call'
    /usr/local/sproutcore/lib/sproutcore/buildfile/task.rb:231:in `block in execute'
    /usr/local/sproutcore/lib/sproutcore/buildfile/task.rb:226:in `each'
    /usr/local/sproutcore/lib/sproutcore/buildfile/task.rb:226:in `execute'
    /usr/local/sproutcore/lib/sproutcore/buildfile/task.rb:183:in `invoke_with_call_chain'
    /usr/local/sproutcore/lib/sproutcore/buildfile/task.rb:140:in `invoke'
    /usr/local/sproutcore/lib/sproutcore/buildfile.rb:214:in `invoke'
    /usr/local/sproutcore/lib/sproutcore/models/manifest_entry.rb:347:in `build_to'
    /usr/local/sproutcore/lib/sproutcore/models/manifest_entry.rb:259:in `build!'
    /usr/local/sproutcore/lib/sproutcore/rack/builder.rb:129:in `block (2 levels) in call'
    /usr/local/sproutcore/lib/sproutcore.rb:161:in `profile'
    /usr/local/sproutcore/lib/sproutcore/rack/builder.rb:128:in `block in call'
    <internal:prelude>:10:in `synchronize'
    /usr/local/sproutcore/lib/sproutcore/rack/builder.rb:89:in `call'
    /usr/local/sproutcore/bundle/ruby/1.9.1/gems/rack-1.4.0/lib/rack/cascade.rb:23:in `block in call'
    /usr/local/sproutcore/bundle/ruby/1.9.1/gems/rack-1.4.0/lib/rack/cascade.rb:22:in `each'
    /usr/local/sproutcore/bundle/ruby/1.9.1/gems/rack-1.4.0/lib/rack/cascade.rb:22:in `call'
    /usr/local/sproutcore/bundle/ruby/1.9.1/gems/rack-1.4.0/lib/rack/showexceptions.rb:24:in `call'
    /usr/local/sproutcore/bundle/ruby/1.9.1/gems/rack-1.4.0/lib/rack/recursive.rb:43:in `_call'
    /usr/local/sproutcore/bundle/ruby/1.9.1/gems/rack-1.4.0/lib/rack/recursive.rb:38:in `call'
    /usr/local/sproutcore/bundle/ruby/1.9.1/gems/rack-1.4.0/lib/rack/conditionalget.rb:25:in `call'
    /usr/local/sproutcore/lib/sproutcore/rack/restrict_ip.rb:59:in `call'
    /usr/local/sproutcore/lib/sproutcore/rack/service.rb:117:in `call'
    /usr/local/sproutcore/bundle/ruby/1.9.1/gems/thin-1.2.11/lib/thin/connection.rb:84:in `block in pre_process'
    /usr/local/sproutcore/bundle/ruby/1.9.1/gems/thin-1.2.11/lib/thin/connection.rb:82:in `catch'
    /usr/local/sproutcore/bundle/ruby/1.9.1/gems/thin-1.2.11/lib/thin/connection.rb:82:in `pre_process'
    /usr/local/sproutcore/bundle/ruby/1.9.1/gems/thin-1.2.11/lib/thin/connection.rb:57:in `process'
    /usr/local/sproutcore/bundle/ruby/1.9.1/gems/thin-1.2.11/lib/thin/connection.rb:42:in `receive_data'
    /usr/local/sproutcore/bundle/ruby/1.9.1/gems/eventmachine-1.0.0.beta.4/lib/eventmachine.rb:179:in `run_machine'
    /usr/local/sproutcore/bundle/ruby/1.9.1/gems/eventmachine-1.0.0.beta.4/lib/eventmachine.rb:179:in `run'
    /usr/local/sproutcore/bundle/ruby/1.9.1/gems/thin-1.2.11/lib/thin/backends/base.rb:61:in `start'
    /usr/local/sproutcore/bundle/ruby/1.9.1/gems/thin-1.2.11/lib/thin/server.rb:159:in `start'
    /usr/local/sproutcore/bundle/ruby/1.9.1/gems/rack-1.4.0/lib/rack/handler/thin.rb:13:in `run'
    /usr/local/sproutcore/lib/sproutcore/rack/service.rb:93:in `start'
    /usr/local/sproutcore/lib/sproutcore/tools/server.rb:65:in `server'
    /usr/local/sproutcore/bundle/ruby/1.9.1/gems/thor-0.14.6/lib/thor/task.rb:22:in `run'
    /usr/local/sproutcore/bundle/ruby/1.9.1/gems/thor-0.14.6/lib/thor/invocation.rb:118:in `invoke_task'
    /usr/local/sproutcore/bundle/ruby/1.9.1/gems/thor-0.14.6/lib/thor.rb:263:in `dispatch'
    /usr/local/sproutcore/bundle/ruby/1.9.1/gems/thor-0.14.6/lib/thor/base.rb:389:in `start'
    /usr/local/sproutcore/lib/sproutcore/tools.rb:452:in `start'
    /usr/local/sproutcore/lib/sproutcore/tools.rb:30:in `invoke'
    /usr/bin/sc-server:11:in `<main>'

这是我点击页面时的日志:

    ArgumentError at /todos
    uncaught throw "Cannot file target sproutcore for entry lib/index.rhtml"

Ruby    /usr/local/sproutcore/lib/sproutcore/models/manifest.rb: in throw, line 316
Web GET localhost/todos
Jump to:
GETPOSTCookiesENV
Traceback (innermost first)

/usr/local/sproutcore/lib/sproutcore/models/manifest.rb: in throw
          throw "Cannot file target #{target_name} for entry #{filename}"...
/usr/local/sproutcore/lib/sproutcore/models/manifest.rb: in entry_for
          throw "Cannot file target #{target_name} for entry #{filename}"...
/usr/local/sproutcore/lib/sproutcore/builders/html.rb: in layout_entry
      @manifest.entry_for(@layout) || @manifest.entry_for(@layout, :hidden => true)...
/usr/local/sproutcore/lib/sproutcore/builders/html.rb: in layout_path
      entry = layout_entry...
/usr/local/sproutcore/lib/sproutcore/builders/html.rb: in render
      if self.layout_path.nil?...
/usr/local/sproutcore/lib/sproutcore/builders/html.rb: in build
      writelines dst_path, [self.render]...
/usr/local/sproutcore/lib/sproutcore/builders/base.rb: in build
        new(entry).build(dst_path)...
/usr/local/sproutcore/lib/buildtasks/build.rake: in block (2 levels) in define!
    SC::Builder::Html.build env[:entry], env[:dst_path]...
/usr/local/sproutcore/lib/sproutcore/buildfile/task.rb: in call
          act.call(self, args)...
/usr/local/sproutcore/lib/sproutcore/buildfile/task.rb: in block in execute
          act.call(self, args)...
/usr/local/sproutcore/lib/sproutcore/buildfile/task.rb: in each
      @actions.each do |act|...
/usr/local/sproutcore/lib/sproutcore/buildfile/task.rb: in execute
      @actions.each do |act|...
/usr/local/sproutcore/lib/sproutcore/buildfile/task.rb: in invoke_with_call_chain
        execute(task_args) if needed?...
/usr/local/sproutcore/lib/sproutcore/buildfile/task.rb: in invoke
      invoke_with_call_chain(task_args, InvocationChain::EMPTY)...
/usr/local/sproutcore/lib/sproutcore/buildfile.rb: in invoke
      self[task_name].invoke(consts)...
/usr/local/sproutcore/lib/sproutcore/models/manifest_entry.rb: in build_to
      buildfile.invoke self[:build_task],...
/usr/local/sproutcore/lib/sproutcore/models/manifest_entry.rb: in build!
      build_to self[:build_path]...
/usr/local/sproutcore/lib/sproutcore/rack/builder.rb: in block (2 levels) in call
                entry.clean!.build!...
/usr/local/sproutcore/lib/sproutcore.rb: in profile
      yield...
/usr/local/sproutcore/lib/sproutcore/rack/builder.rb: in block in call
              SC.profile("PROFILE_BUILD") do...
<internal:prelude>: in synchronize
/usr/local/sproutcore/lib/sproutcore/rack/builder.rb: in call
        project_mutex.synchronize do...
/usr/local/sproutcore/bundle/ruby/1.9.1/gems/rack-1.4.0/lib/rack/cascade.rb: in block in call
        result = app.call(env)...
/usr/local/sproutcore/bundle/ruby/1.9.1/gems/rack-1.4.0/lib/rack/cascade.rb: in each
      @apps.each do |app|...
/usr/local/sproutcore/bundle/ruby/1.9.1/gems/rack-1.4.0/lib/rack/cascade.rb: in call
      @apps.each do |app|...
/usr/local/sproutcore/bundle/ruby/1.9.1/gems/rack-1.4.0/lib/rack/showexceptions.rb: in call
      @app.call(env)...
/usr/local/sproutcore/bundle/ruby/1.9.1/gems/rack-1.4.0/lib/rack/recursive.rb: in _call
      @app.call(env.merge('rack.recursive.include' => method(:include)))...
/usr/local/sproutcore/bundle/ruby/1.9.1/gems/rack-1.4.0/lib/rack/recursive.rb: in call
      dup._call(env)...
/usr/local/sproutcore/bundle/ruby/1.9.1/gems/rack-1.4.0/lib/rack/conditionalget.rb: in call
        status, headers, body = @app.call(env)...
/usr/local/sproutcore/lib/sproutcore/rack/restrict_ip.rb: in call
          return @app.call(env)...
/usr/local/sproutcore/lib/sproutcore/rack/service.rb: in call
      def call(env); @app.call(env); end...
/usr/local/sproutcore/bundle/ruby/1.9.1/gems/thin-1.2.11/lib/thin/connection.rb: in block in pre_process
        response = @app.call(@request.env)...
/usr/local/sproutcore/bundle/ruby/1.9.1/gems/thin-1.2.11/lib/thin/connection.rb: in catch
      catch(:async) do...
/usr/local/sproutcore/bundle/ruby/1.9.1/gems/thin-1.2.11/lib/thin/connection.rb: in pre_process
      catch(:async) do...
/usr/local/sproutcore/bundle/ruby/1.9.1/gems/thin-1.2.11/lib/thin/connection.rb: in process
        post_process(pre_process)...
/usr/local/sproutcore/bundle/ruby/1.9.1/gems/thin-1.2.11/lib/thin/connection.rb: in receive_data
      process if @request.parse(data)...
/usr/local/sproutcore/bundle/ruby/1.9.1/gems/eventmachine-1.0.0.beta.4/lib/eventmachine.rb: in run_machine
        run_machine...
/usr/local/sproutcore/bundle/ruby/1.9.1/gems/eventmachine-1.0.0.beta.4/lib/eventmachine.rb: in run
        run_machine...
/usr/local/sproutcore/bundle/ruby/1.9.1/gems/thin-1.2.11/lib/thin/backends/base.rb: in start
          EventMachine.run(&starter)...
/usr/local/sproutcore/bundle/ruby/1.9.1/gems/thin-1.2.11/lib/thin/server.rb: in start
      @backend.start...
/usr/local/sproutcore/bundle/ruby/1.9.1/gems/rack-1.4.0/lib/rack/handler/thin.rb: in run
        server.start...
/usr/local/sproutcore/lib/sproutcore/rack/service.rb: in start
        server.run app, opts...
/usr/local/sproutcore/lib/sproutcore/tools/server.rb: in server
          SC::Rack::Service.start(options.merge(:project => project))...
/usr/local/sproutcore/bundle/ruby/1.9.1/gems/thor-0.14.6/lib/thor/task.rb: in run
        instance.send(name, *args) : instance.class.handle_no_task_error(name)...
/usr/local/sproutcore/bundle/ruby/1.9.1/gems/thor-0.14.6/lib/thor/invocation.rb: in invoke_task
        task.run(self, *args)...
/usr/local/sproutcore/bundle/ruby/1.9.1/gems/thor-0.14.6/lib/thor.rb: in dispatch
        new(args, opts, config).invoke_task(task, trailing || [])...
/usr/local/sproutcore/bundle/ruby/1.9.1/gems/thor-0.14.6/lib/thor/base.rb: in start
        dispatch(nil, given_args.dup, nil, config)...
/usr/local/sproutcore/lib/sproutcore/tools.rb: in start
          super(args)...
/usr/local/sproutcore/lib/sproutcore/tools.rb: in invoke
      start([task_name.to_s] + ARGV)...
/usr/bin/sc-server: in <main>
SC::Tools.invoke 'server'...
Request information

GET
No GET data.
POST
No POST data.
COOKIES
No cookie data.
Rack ENV
Variable    Value
GATEWAY_INTERFACE   
CGI/1.2
HTTP_ACCEPT 
text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HTTP_ACCEPT_CHARSET 
ISO-8859-1,utf-8;q=0.7,*;q=0.3
HTTP_ACCEPT_ENCODING    
gzip,deflate,sdch
HTTP_ACCEPT_LANGUAGE    
en-US,en;q=0.8
HTTP_CONNECTION 
keep-alive
HTTP_HOST   
localhost:4020
HTTP_USER_AGENT 
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.77 Safari/535.7
HTTP_VERSION    
HTTP/1.1
PATH_INFO   
/todos
QUERY_STRING    
REMOTE_ADDR 
127.0.0.1
REQUEST_METHOD  
GET
REQUEST_PATH    
/todos
REQUEST_URI 
/todos
SCRIPT_NAME 
SERVER_NAME 
localhost
SERVER_PORT 
4020
SERVER_PROTOCOL 
HTTP/1.1
SERVER_SOFTWARE 
thin 1.2.11 codename Bat-Shit Crazy
async.callback  
#<Method: Thin::Connection#post_process>
async.close 
#<EventMachine::DefaultDeferrable:0x00000100d35df0>
rack.errors 
#<IO:<STDERR>>
rack.input  
#<StringIO:0x00000100d38aa0>
rack.multiprocess   
false
rack.multithread    
false
rack.recursive.include  
#<Method: Rack::Recursive#include>
rack.request.cookie_hash    
{}
rack.request.query_hash 
{}
rack.request.query_string   
rack.run_once   
false
rack.url_scheme 
http
rack.version    
[1, 0]
You're seeing this error because you use Rack::ShowExceptions.

2 个答案:

答案 0 :(得分:2)

只需按照高级安装: http://sproutcore.com/install_mac/#tab=advanced-install 它会解决它。 如果您没有git(高级安装的第1点),则不推荐使用第三行。使用“bash -s stable&lt;&lt;(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer) “而不是”./rvm-installer --version latest“。

答案 1 :(得分:1)

服务器找不到sproutcore源。尝试创建一个框架目录(与apps目录并行),并将git克隆sproutcore到其中。然后在项目中执行以下操作。

rm -rf tmp
sc-server

你不应该来做这件事。构建工具应该(以前)拥有自己使用的SC副本。

我的解决方案是仅指定您自己的SC源代码库(通过将其置于框架中)并且sc-server应该找到它。现在您可以对源进行修改,它们将在您的项目中使用。你也可以用这种方式切换sproutcore的版本;例如你可以做到

git checkout REL-1.7.0

来自frameworks/sproutcore目录