Bundle install 将 gems 安装在 ./mysql2 文件夹中
我最近在我的机器上升级了mysql。因此,我正在尝试相应地更新我的 mysql2 gem。在此过程中,我运行“bundle install”,由于某种原因,我的 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 目录还包含一个配置文件,表明 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 目录中,所以我决定在挖更深的洞之前停止)
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)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这实际上是我几周前遇到的问题的已弃用行为。您可能运行了命令
bundle install mysql
,它实际上运行bundle install --path mysql
并将其安装目录永久设置为 ./mysql2 (尽可能少有意义) )。解决此问题的最简单方法是运行bundle install --system
,这应该会恢复您的默认安装目录。下次如果您想升级单个 gem,请使用命令bundle update mysql
。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 runsbundle 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 runningbundle install --system
, and that should restore your default install directory. Next time if you want to upgrade a single gem, use the commandbundle update mysql
.我不确定为什么它要全部安装到 mysql2 文件夹中,但要让它恢复到应如何运行:
bundle install --pathvendor
然后您应该能够安全地删除 mysql2文件夹,您的宝石将位于它们应该在的位置。希望其他人能够解释为什么它安装到另一个文件夹中。
I'm not sure why it's installing all to a mysql2 folder, but to get it back to how it should be run this:
bundle install --path vendor
You should then be able to safely delete the mysql2 folder and your gems will be where they should be. Hopefully somebody else will be able to explain why it installed into that other folder.