gpt4 book ai didi

mysql - 为什么安装成功后在gem list下没有出现mysql?

转载 作者:行者123 更新时间:2023-11-29 09:16:06 26 4
gpt4 key购买 nike

这是交易:
$ gem -v

1.3.7  

$ gem 环境

RubyGems Environment:
- RUBYGEMS VERSION: 1.3.7
- RUBY VERSION: 1.9.2 (2010-08-18 patchlevel 0) [x86_64-darwin10.4.0]
- INSTALLATION DIRECTORY: /Users/harriett/.rvm/gems/ruby-1.9.2-p0@rails3tutorial
- RUBY EXECUTABLE: /Users/harriett/.rvm/rubies/ruby-1.9.2-p0/bin/ruby
- EXECUTABLE DIRECTORY: /Users/harriett/.rvm/gems/ruby-1.9.2-p0@rails3tutorial/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-10
- GEM PATHS:
- /Users/harriett/.rvm/gems/ruby-1.9.2-p0@rails3tutorial
- /Users/harriett/.rvm/gems/ruby-1.9.2-p0@global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
$ sudo env ARCHFLAGS="-arch i386"gem install mysql -- --with-mysql-config=/Applications/MAMP/Library/bin/mysql_config

Building native extensions.  This could take a while...  
Successfully installed mysql-2.8.1
1 gem installed

$ gem 列表 mysql

* LOCAL GEMS *  

为什么不显示?
当然,当我在 ruby​​ 程序中需要“mysql”时,我得到:

`require': no such file to load -- mysql (LoadError)  

最佳答案

您的 Ruby 安装由 RVM 管理。请参阅 RVM 站点上的“DO NOT use sudo...”。

尝试在不使用 sudo 的情况下安装它,它应该会显示在您的 gemlist 中。

关于mysql - 为什么安装成功后在gem list下没有出现mysql?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4176112/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com