捆绑安装在./mysql2文件夹中安装宝石[英] Bundle install installs gems in ./mysql2 folder

本文是小编为大家收集整理的关于捆绑安装在./mysql2文件夹中安装宝石的处理方法,想解了捆绑安装在./mysql2文件夹中安装宝石的问题怎么解决?捆绑安装在./mysql2文件夹中安装宝石问题的解决办法?那么可以参考本文帮助大家快速定位并解决问题。

问题描述

我最近在我的机器上升级了mysql.结果,我正在尝试相应地更新我的MySQL2宝石.在这样做的过程中,我运行"捆绑安装",出于某种原因,我的Gemfile中的所有Gem都已安装在一个./mysql2目录中??

ruby-1.9.2-p180 [dev]:project.git$ bundle install
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /Users/al/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.10/lib/bundler/shared_helpers.rb:3.
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /Users/al/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.10/lib/bundler/source.rb:162.
NOTE: Gem::SourceIndex#each is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#each called from /Users/al/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.10/lib/bundler/source.rb:162.
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /Users/al/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.10/lib/bundler/source.rb:162.
NOTE: Gem::SourceIndex#each is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#each called from /Users/al/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.10/lib/bundler/source.rb:162.
Fetching source index for http://rubygems.org/
Installing rake (0.8.7) 
Installing ZenTest (4.5.0) 
Installing abstract (1.0.0) WARNING: abstract-1.0.0 has an invalid nil value for @cert_chain

Installing activesupport (3.0.7) 
Installing builder (2.1.2) WARNING: builder-2.1.2 has an invalid nil value for @cert_chain

Installing i18n (0.5.0) 
Installing activemodel (3.0.7) 
Installing erubis (2.6.6) 
.
.
.
Installing typhoeus (0.2.4) with native extensions 
Installing webrat (0.7.3) 
Installing will_paginate (2.3.15) 
Your bundle is complete! It was installed into ./mysql2

出于某种原因,我的.bundle dir包含一个配置文件,指示bundle_path是mysql2?我不知道这来自哪里或者它如何到达...

ruby-1.9.2-p180 [dev]:project.git$ ls
Gemfile     README      app     config.ru   doc     log     mysql2      script      test
Gemfile.lock    Rakefile    config      db      lib     misc        public      spec        vendor
ruby-1.9.2-p180 [dev]:project.git$ ls -a
.       .git        Gemfile     Rakefile    config.ru   lib     mysql2      spec
..      .gitignore  Gemfile.lock    app     db      log     public      test
.bundle     .rspec      README      config      doc     misc        script      vendor
ruby-1.9.2-p180 [dev]:project.git$ cd .bundle
ls
ruby-1.9.2-p180 [dev]:.bundle$ ls
config
ruby-1.9.2-p180 [dev]:.bundle$ cat config
--- 
BUNDLE_DISABLE_SHARED_GEMS: "1"
BUNDLE_PATH: mysql2

这是我的gemfile:

source 'http://rubygems.org'

gem 'rake'
gem 'rails'
gem 'mysql2', '0.2.6'
gem 'legacy_data'
gem 'htmlentities'
gem 'httparty'
gem 'net-ssh'
gem 'net-sftp'
gem 'rsolr'
gem 'activerecord-import'
gem 'ar-extensions'
gem 'typhoeus'
gem 'composite_primary_keys'
gem 'devise'
gem 'authlogic'
gem 'will_paginate'
gem 'json_pure' # Note that installing the 'json' gem results in a "[BUG] unknown type 0x22 (0xc given)" error when loading rails console
gem "friendly_id", "~> 3.2.1"

# Use unicorn as the web server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger (ruby-debug for Ruby 1.8.7+, ruby-debug19 for Ruby 1.9.2+)
# gem 'ruby-debug'
# gem 'ruby-debug19'

# Bundle the extra gems:
# gem 'bj'
# gem 'nokogiri'
# gem 'sqlite3-ruby', :require => 'sqlite3'
# gem 'aws-s3', :require => 'aws/s3'

# Gems for RSpec
# Bundle gems for the local environment. Make sure to
# put test-only gems in this group so their generators
# and rake tasks are available in development mode:
group :search_development, :test do
  gem 'rspec-rails', "~> 2.4"
  gem 'webrat'
  gem 'rspec'
end

gem 'autotest'

我一直在旋转我的轮子一段时间.提前谢谢任何关于如何进行的想法或想法. (也是,这是我第二次捆绑到MySQL2目录中的第二次,所以我现在决定在挖掘更深的洞之前停止)

推荐答案

它实际上已弃用行为,即几个星期前我有问题.它可能是您运行的命令bundle install mysql,它实际上运行bundle install --path mysql并永久设置其安装目录到./mysql2(只要少于义).解决此问题的最简单方法是通过运行bundle install --system,并且应该恢复默认安装目录.下次如果要升级单个GEM,请使用命令bundle update mysql.

其他推荐答案

我不确定为什么它将全部安装到mysql2文件夹中,但要将其恢复到应该如何运行:bundle install --path vendor

然后,您应该能够安全地删除MySQL2文件夹,您的宝石将是他们应该的地方.希望其他人可以解释为什么它安装到该另一个文件夹中.

本文地址:https://www.itbaoku.cn/post/786427.html