本文介绍了Bundle安装在./mysql2文件夹中安装gems的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我最近在我的机器上升级了mysql。因此,我试图相应地更新我的mysql2宝石。在这样做的过程中,我运行bundle install,出于某种原因,我的Gemfile中的所有gem都安装在./mysql2目录中? ruby-1.9.2-p180 [dev]:project.git $ bundle install
注意:Gem.source_index已弃用,请使用规范。它将在2011年11月1日或之后删除。
Gem.source_index从/Users/al/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.10/lib/bundler/shared_helpers.rb:3调用。
注意:Gem.source_index已弃用,请使用Specification。它将在2011年11月1日或之后删除。
Gem.source_index从/Users/al/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.10/lib/bundler/source.rb:162调用。
注意:每个Gem :: SourceIndex#都被弃用,不需要替换。它将在2011年11月1日或之后删除。
Gem :: SourceIndex#每个都从/Users/al/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.10/lib/bundler/source.rb:162中调用。
注意:Gem.source_index已弃用,请使用Specification。它将在2011年11月1日或之后删除。
Gem.source_index从/Users/al/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.10/lib/bundler/source.rb:162调用。
注意:每个Gem :: SourceIndex#都被弃用,不需要替换。它将在2011年11月1日或之后删除。
Gem :: SourceIndex#每个都从/Users/al/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.10/lib/bundler/source.rb:162中调用。
获取http://rubygems.org/
的源索引安装rake(0.8.7)
安装ZenTest(4.5.0)
安装abstract(1.0.0)警告:abstract-1.0.0对于@cert_chain
有一个无效的值无效安装activesupport(3.0.7)
安装构建器(2.1.2)警告:builder-2.1.2有一个无效nil @cert_chain
安装i18n(0.5.0)
安装activemodel(3.0.7)
安装erubis(2.6.6)
。
。
。
使用原生扩展安装typhoeus(0.2.4)
安装webrat(0.7.3)
安装will_paginate(2.3.15)
您的软件包已完成!它被安装到./mysql2
由于某些原因,我的.bundle目录也包含一个配置文件表示BUNDLE_PATH是mysql2?我不知道这是从哪里来的,或者它是如何到达那里的......
ruby-1.9.2-p180 [dev ]:project.git $ ls
Gemfile README app config.ru doc log mysql2脚本测试
Gemfile.lock Rakefile config db lib misc公共规范供应商
ruby-1.9.2-p180 [dev ]:project.git $ ls -a
。 .git Gemfile Rakefile config.ru lib mysql2 spec
。.gitignore Gemfile.lock应用程序db日志公共测试
.bundle .rspec自述文件config doc其他脚本供应商
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'
ge m'will_paginate'
gem'json_pure'#请注意,在加载rails console
gemfriendly_id时,安装'json'gem会导致出现[BUG] unknown type 0x22(0xc given)错误, 〜> 3.2.1
#使用独角兽作为Web服务器
#gem'unicorn'
#使用Capistrano部署
#gem'capistrano'
#使用调试器(ruby-debug for Ruby 1.8.7+,ruby-debug19 for Ruby 1.9.2+)
#gem'ruby-debug'
#gem' ruby-debug19'
#捆绑额外的宝石:
#gem'bj'
#gem'nokogiri'
#gem'sqlite3-ruby',:require =>'sqlite3'
#gem'aws-s3',:require =>'aws / s3'
#RSpec的宝石
#本地捆绑宝石确保
#把test-only gems放在这个组中,所以它们的生成器
#和rake任务可以在开发模式中使用:
group:search_development,:test do
gem'rspec-rails',〜> 2.4
gem'webrat'
gem'rspec'
end
gem'autotest'
我已经在这方面花费了一段时间了,对于任何有关如何进行的想法或想法,都要提前感谢(另外,这是第二次我已经将bundle安装到了mysql2目录中,所以我决定在挖掘更深的洞之前停下来)
解决方案 它实际上已经被弃用,几周前我遇到了一个问题,很可能你运行了命令 bundle install mysql
,它实际上运行了 bundle install - -path mysql
并永久性地将它的安装目录设置为./mysql2(尽量少用)。解决这个问题的最简单方法是运行 bundle install - 系统
,并且应该还原你的默认安装目录。下次如果你想升级一个gem,使用命令 bundle update mysql
。
I recently upgraded mysql on my machine. As a result I'm attempting to update my mysql2 gem accordingly. In the process of doing that, I run "bundle install", and for some reason all of the gems in my Gemfile are getting installed in a ./mysql2 directory??
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
For some reason, also my .bundle dir contains a config file that indicates the BUNDLE_PATH is mysql2? I don't know where this came from or how it got there...
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
Here's my 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'
I've been spinning my wheels on this for some time. Thanks ahead of time for any ideas or thoughts about how to proceed. (Also, this is the second time that I've bundle installed into a mysql2 dir, so I've decided to stop now before I dig a deeper hole)
解决方案
It's actually deprecated behavior that I had a problem with a couple weeks ago. It's likely you ran the command bundle install mysql
, which actually runs bundle install --path mysql
and permanently sets its install directory to ./mysql2 (as little as that makes sense). The easiest way to fix this from happening is by running bundle install --system
, and that should restore your default install directory. Next time if you want to upgrade a single gem, use the command bundle update mysql
.
这篇关于Bundle安装在./mysql2文件夹中安装gems的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!