Ruby所需资源?

时间:2014-02-05 09:55:43

标签: ruby-on-rails ruby sqlite rubygems

我一生中从未在Ruby中编程,但我听说它在程序上类似于Python(我在其中编程)。

然而,我最近下载了Crunchbang并正在下载一个Rubuy程序。我安装了Ruby:

apt-get install ruby
apt-get install rubygems
apt-get install sqlite3

当我运行该文件时,我受到了欢迎:

root@crunchbang:/Pentest/NTLMRelay/ZackAttack# ruby zackattack.rb 
/usr/lib/ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find sqlite3 (= 1.3.6) amongst [] (Gem::LoadError)
    from /usr/lib/ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
    from /usr/lib/ruby/1.9.1/rubygems.rb:1231:in `gem'
    from /Pentest/NTLMRelay/ZackAttack/lib/zfdb.rb:7:in `<top (required)>'
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:60:in `require'
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require'
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
    from /Pentest/NTLMRelay/ZackAttack/clients/ews.rb:9:in `<top (required)>'
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:60:in `require'
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require'
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
    from /Pentest/NTLMRelay/ZackAttack/lib/zfclient.rb:6:in `<top (required)>'
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:60:in `require'
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require'
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
    from /Pentest/NTLMRelay/ZackAttack/lib/zfhttpd.rb:7:in `<top (required)>'
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:60:in `require'
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require'
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
    from zackattack.rb:8:in `<main>'

我完全不知所措。感谢帮助/

3 个答案:

答案 0 :(得分:0)

您还需要安装ruby gem:

gem install sqlite3

如果您的程序有Gemfile,请执行:

gem install bundler
bundle install

另一个建议是,通过RVM安装ruby,它可以避免一些麻烦。

更新:

您很可能还需要以下套餐:

sudo apt-get install libsqlite3-ruby

答案 1 :(得分:0)

您还可以使用安装,如下所示:

apt-get install ruby-sqlite3

或在我的情况下:

apt-get install sqlite3-ruby

答案 2 :(得分:0)

我会避免使用apt-get安装Ruby,因为你将面临很多问题(版本,宝石管理等)。改为使用RVM。

删除apt-get次安装(特别是ruby -v在1.9之前返回的内容),然后按照http://rvm.io/rvm/install上的说明进行操作

RVM将允许您安装多个Ruby版本并更轻松地管理您的宝石。

完成rvm安装后,请执行以下操作:

gem install sqlite3 -v 1.3.6

一旦你有RVM运行,事情应该变得更容易......不要担心你在开始时花费的额外时间,它会得到回报: - )