简体   繁体   English

sudo gem install sqlite3和gem install sqlite3错误

[英]Error with sudo gem install sqlite3 and gem install sqlite3

Error with 'gem install sqlite3' “ gem install sqlite3”错误

'ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.' '错误:执行gem时...(Gem :: FilePermissionError)您没有对/Library/Ruby/Gems/2.0.0目录的写权限。

And this error while 'sudo gem install sqlite3' 而“ sudo gem install sqlite3”时出现此错误

"1 warning generated. compiling exception.c compiling sqlite3.c compiling statement.c linking shared-object sqlite3/sqlite3_native.bundle clang: error: unknown argument: '-multiply_definedsuppress' [-Wunused-command-line-argument-hard-error-in-future] clang: note: this will be a hard error (cannot be downgraded to a warning) in the future make: * [sqlite3_native.bundle] Error 1 “生成了1条警告。编译异常。c编译sqlite3.c编译语句。链接共享对象sqlite3 / sqlite3_native.bundle clang:错误:未知参数:'-multiply_definedsuppress'[-Wunused-command-line-argument-hard-error -in-future]叮当声:注意:这将是将来出现的硬错误(无法降级为警告): * [sqlite3_native.bundle]错误1

make failed, exit code 2 制作失败,退出代码2

Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/sqlite3-1.3.9 for inspection. 宝石文件将保留安装在/Library/Ruby/Gems/2.0.0/gems/sqlite3-1.3.9中,以进行检查。 Results logged to /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-13/2.0.0/sqlite3-1.3.9/gem_make.out" 结果记录到/Library/Ruby/Gems/2.0.0/extensions/universal-darwin-13/2.0.0/sqlite3-1.3.9/gem_make.out”

I have installed RVM and also used 'sudo' gem install sqlite3 and gem install sqlite3 . 我已经安装了RVM,还使用了'sudo'gem install sqlite3和gem install sqlite3。 What am I missing? 我想念什么?

Thx! 谢谢!

You should not use sudo with rvm. 您不应将sudo与rvm一起使用。 However, it may be that your rvm default ruby is the system ruby. 但是,可能是您的rvm默认红宝石是系统红宝石。

To install a new ruby version using rvm: 要使用rvm安装新的ruby版本:

rvm install 2.1.1

After that is installed do a rvm list to make sure it is installed: 安装之后,请执行rvm列表以确保已安装:

rvm list

And you will get a list of installed rubies. 您将获得已安装红宝石的列表。

rvm rubies

   ruby-2.0.0-p247 [ x86_64 ]
   ruby-2.1.1 [ x86_64 ]

# => - current
# =* - current && default
#  * - default

Note that it will show a list. 请注意,它将显示一个列表。 You need to select the one you just installed if it is not selected already: 如果尚未安装,则需要选择刚刚安装的一个:

 rvm use 2.1.1

Then, running rvm list again, you should see something like this: 然后,再次运行rvm list,您应该看到类似以下内容:

rvm rubies

   ruby-2.0.0-p247 [ x86_64 ]
=* ruby-2.1.1 [ x86_64 ]

# => - current
# =* - current && default
#  * - default

Note the difference, and how now I have my local 2.1.1 ruby selected. 注意区别,以及现在如何选择本地2.1.1红宝石。 Now it would be safe to run 现在可以安全运行

gem install sqlite3

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM