捆绑安装无法正常工作

时间:2012-08-28 05:48:29

标签: ruby-on-rails ruby

我目前正在安装Redmine并关注these steps(我在安装过程 - > step2 ) 当我试图做bundle install --without development test rmagick时,我得到了错误。

输出

  

$ sudo bundle install --without development test rmagick

     

http://rubygems.org/获取宝石元数据.......              用耙子   (0.9.2.2)使用activesupport(2.3.14)
  使用机架(1.1.3)使用actionpack(2.3.14)
  使用actionmailer(2.3.14)使用activerecord(2.3.14)
  使用activeresource(2.3.14)使用coderay(1.0.7)使用fastercsv   (1.5.5)使用i18n(0.4.2)使用本机安装mysql(2.8.1)   扩展Gem :: Installer :: ExtensionBuildError:错误:失败   构建gem原生扩展。

    /usr/bin/ruby1.8 extconf.rb --with-mysql-config=/usr/local/mysql/bin/mysql_config extconf.rb:10: command not found: /usr/local/mysql/bin/mysql_config --cflags
     

* extconf.rb失败* 由于某些原因无法创建Makefile,可能缺少必要的   库和/或标题。检查mkmf.log文件以获取更多信息   细节。您可能需要配置选项       提供配置选项: - with-opt-dir --without-opt-dir
    --with-OPT-包括
    --without-OPT-包括= $ {停用DIR} /包括
    --with-opt-lib --without-opt-lib = $ {opt-dir} / lib
    --with-make-prog --without-make-prog
    --srcdir =。 --curdir --ruby = / usr / bin / ruby​​1.8
    --with-mysql-config

     

Gem文件将保留在/var/lib/gems/1.8/gems/mysql-2.8.1中   检查。记录结果   /var/lib/gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_make.out

     

安装mysql(2.8.1)时出错,而Bundler不能   继续。确保gem install mysql -v '2.8.1'   在捆绑之前成功。

然后我按了THIS教程并删除了.bundle/config并再次尝试,但仍然无效。

以及THIS也没有帮助(同样的错误)。

以下是 /var/lib/gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_make.out

的CAT

enter image description here

更新:1

但我在/usr/local/中没有 mysql 文件夹,我也不能locate bin/mysql_config



更新:2

我结束了第一个问题(mysql问题,这是一个路径问题),我最终得到另一个问题:请检查:

  

sudo bundle install --without development test rmagick    
Fetching gem metadata from http://rubygems.org/.......    
Using rake (0.9.2.2) 
Using activesupport (2.3.14) 
Using rack (1.1.3) 
Using actionpack (2.3.14) 
Using actionmailer (2.3.14) 
Using activerecord (2.3.14) 
Using activeresource (2.3.14) 
Using coderay (1.0.7) 
Using fastercsv (1.5.5) 
Using i18n (0.4.2) 
Using mysql (2.8.1) 
Using net-ldap (0.3.1) 
Installing pg (0.14.0) with native extensions 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /usr/bin/ruby1.8 extconf.rb 
checking for pg_config... no
No pg_config... trying anyway. If building fails, please try again with
 --with-pg-config=/path/to/pg_config
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/usr/bin/ruby1.8
    --with-pg
    --without-pg
    --with-pg-dir
    --without-pg-dir
    --with-pg-include
    --without-pg-include=${pg-dir}/include
    --with-pg-lib
    --without-pg-lib=${pg-dir}/lib
    --with-pg-config
    --without-pg-config
    --with-pg_config
    --without-pg_config


Gem files will remain installed in /var/lib/gems/1.8/gems/pg-0.14.0 for inspection.
Results logged to /var/lib/gems/1.8/gems/pg-0.14.0/ext/gem_make.out
An error occured while installing pg (0.14.0), and Bundler cannot continue.
Make sure that `gem install pg -v '0.14.0'` succeeds before bundling.

4 个答案:

答案 0 :(得分:3)

注意它说“找不到命令:... / mysql_config”这意味着它试图运行mysql_config程序,但它不在那里(你的系统上不存在,或者已安装)别的地方)。它甚至可以正确地猜测“可能缺少必要的库和/或标题”的问题。 Rubygems不知道它失败的原因,只是它失败了(因为这在运行makefile时发生,并且Rubygems不知道每个gems的特定构建问题和依赖关系),但它会记录所有信息给你了解更多。请注意,它会检查'/var/lib/gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_make.out'文件以获取更多信息。你可以cat /var/lib/gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_make.out看到更多,但在这一点上你似乎很清楚你错过了mysql。

我不知道如何为你的系统安装mysql,但应该有一些包管理器可以为你做。我知道apt-get很常见,我认为Ubuntu有类似synaptic的东西,我也听说过一个叫做pacman的东西。无论你使用什么来在你的系统上安装东西,它应该能够为你安装mysql,所以我从那里开始。

答案 1 :(得分:1)

您可能需要先安装mysql服务器。

答案 2 :(得分:1)

运行此操作,然后运行bundle install

sudo apt-get install build-essential zlib1g-dev libssl-dev libreadline-dev libruby1.9

答案 3 :(得分:0)

对你的问题很简单 看看这一步

1>>> / opt / metasploit / msf3 #gem unpack bundle install 解压宝石:'/ opt / metasploit / msf3 / bundle-0.0.1' 错误:Gem'install'未安装也无法获取。

2 - ;>>

root @bt:/ opt / metasploit / msf3#bundle install 从https://rubygems.org/获取宝石元数据......... 从https://rubygems.org/获取gem元数据.. 使用rake(10.1.0) 使用i18n(0.6.5) 使用multi_json(1.0.4) 使用activesupport(3.2.14) 使用构建器(3.0.4) 使用activemodel(3.2.14) 使用arel(3.0.2) 使用tzinfo(0.3.37) 使用activerecord(3.2.14) 使用database_cleaner(1.1.1) 使用diff-lcs(1.2.4) 使用factory_girl(4.2.0) 使用fivemat(1.2.1) 使用json(1.8.0) 安装pg(0.16.0) 安装metasploit_data_models(0.16.6) 安装mini_portile(0.5.1) 安装msgpack(0.5.5) 安装network_interface(0.0.1) 安装nokogiri(1.6.0) 安装packetfu(1.1.9) 安装pcaprub(0.11.3) 安装redcarpet(3.0.0) 安装机器人(0.10.1) 安装rspec-core(2.14.5) 安装rspec-expectations(2.14.2) 安装rspec-mocks(2.14.3) 安装rspec(2.14.1) 安装shoulda-matcher(2.3.0) 安装simplecov-html(0.5.3) 安装simplecov(0.5.4) 安装timecop(0.6.3) 安装场(0.8.7) 使用bundler(1.3.5) 你的包很完整! 使用bundle show [gemname]查看捆绑的gem的安装位置。

3>>>成功完成您的metasploit工作

root @ bt:/ opt / metasploit / msf3#msfconsole 注意:ALTER TABLE将为串行列“vulns_refs.id”创建隐式序列“vulns_refs_id_seq” 注意:ALTER TABLE / ADD PRIMARY KEY将为表“vulns_refs”创建隐式索引“vulns_refs_pkey” 注意:CREATE TABLE将为串行列“task_creds.id”创建隐式序列“task_creds_id_seq” 注意:CREATE TABLE / PRIMARY KEY将为表“task_creds”创建隐式索引“task_creds_pkey” 注意:CREATE TABLE将为串行列“task_hosts.id”创建隐式序列“task_hosts_id_seq” 注意:CREATE TABLE / PRIMARY KEY将为表“task_hosts”创建隐式索引“task_hosts_pkey” 注意:CREATE TABLE将为串行列“task_services.id”创建隐式序列“task_services_id_seq” 注意:CREATE TABLE / PRIMARY KEY将为表“task_services”创建隐式索引“task_services_pkey” 注意:ALTER TABLE将为串行列“hosts_tags.id”创建隐式序列“hosts_tags_id_seq” 注意:ALTER TABLE / ADD PRIMARY KEY将为表“hosts_tags”创建隐式索引“hosts_tags_pkey” 注意:CREATE TABLE将为串行列“task_sessions.id”创建隐式序列“task_sessions_id_seq” 注意:CREATE TABLE / PRIMARY KEY将为表“task_sessions”创建隐式索引“task_sessions_pkey”  _ _ / \ / \ __ _ __ / / _ | | \ / | \ \ _ | | / \ _ \ \ \ | | / | | | \ | - - | / \ / _ \ | - / | || | || | | - - | | _ | | | | | _ | | _ / - \ \ \ | | | | __ / | | | | _       | / | _ / _ _ / / \ _ _ _ / / __ | | _ \ _ \

   =[ metasploit v4.9.0-dev [core:4.9 api:1.0]

+ - - = [1236 exploitits - 676辅助 - 197 post + - - = [326个有效载荷 - 31个编码器 - 8个nops

我希望你的问题得到解决