0

我正在运行 Resque 的 PHP 版本,并且想使用 Resque 的 Ruby 版本附带的 Sinatra 前端应用程序。(https://github.com/defunkt/resque-web)

问题:在我的 Ubuntu 机器上,我安装了 Ruby、Gems 和 Sinatra。当我尝试启动时server.rb,出现如下所示的错误。

几乎没有 Ruby 的经验,任何让这个应用程序工作的帮助都会很棒:)

错误

server.rb:1:in `require': no such file to load -- sinatra/base (LoadError)
    from server.rb:1

我做了什么

git clone https://github.com/defunkt/resque-web.git
sudo apt-get install ruby-full build-essential
sudo apt-get install rubygems
gem install sinatra
cd resque-web
ruby server.rb

红宝石

ruby -v
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]

尝试 2

应该是越来越差了...

添加到 server.rb 的顶部

require 'rubygems'

错误

/usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require': no such file to load -- resque (LoadError)

尝试 3

gem install resque
ruby server.rb

错误

[WARNING] MultiJson is using the default adapter (ok_json). We recommend loading a different JSON library to improve performance.
/var/lib/gems/1.8/gems/resque-1.23.0/lib/resque/helpers.rb:6: Please install the yajl-ruby or json gem (RuntimeError)
        from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
        from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `require'
        from /var/lib/gems/1.8/gems/resque-1.23.0/lib/resque.rb:10
        from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:59:in `gem_original_require'
        from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:59:in `require'
        from server.rb:4

做过:

gem install json gem
ruby server.rb

错误

:public is no longer used to avoid overloading Module#public, use :public_folder instead from server.rb:13

尝试 4

改变了

    set :public, "#{dir}/server/public"

    set :public_folder, "#{dir}/server/public"

现在当我ruby server.rb,什么都没有发生,我拿回了外壳......

4

1 回答 1

1

使用 gems 安装 Resque,gem install resque然后从命令行运行 resque-web。参考:github.com/defunkt/resque

于 2012-12-31T10:22:21.130 回答