简体   繁体   English

rbenv 命令行 gems 设置与系统安装

[英]rbenv command line gems setup with system install

I am using the chef rbenv recipe ( https://github.com/fnichol/chef-rbenv ), doing a system wide install (goes into /usr/local/rbenv) with the rails lastmile cookbook ( https://github.com/DanThiffault/rails-lastmile ).我正在使用厨师rbenv食谱( https://github.com/fnichol/chef-rbenv ),使用 rails lastmile 食谱( https://github. com/DanThiffault/rails-lastmile )。 The server works fine, I can install gems, but command line gems don't seem to work ( valkyrie , mysql2psql ).服务器工作正常,我可以安装 gems,但命令行 gems 似乎不起作用( valkyriemysql2psql )。

Do I need to do additional work to get this working?我是否需要做额外的工作才能使其正常工作?

You have to run rbenv rehash everytime you install a gem with a command line script when using rbenv.使用 rbenv 时,每次使用命令行脚本安装 gem 时都必须运行rbenv rehash

If you installed the gems in a bundle and are running the command from within the directory where the Gemfile is located, @riley's suggestion might be enough.如果您将 gem 安装在一个包中并从Gemfile所在的目录中运行命令,@ Gemfile的建议可能就足够了。 Otherwise, rehash is the command that will make the executables available on the path.否则, rehash是使可执行文件在路径上可用的命令。

I'm new to rbenv from rvm where it just seemed to work.我是 rvm 的 rbenv 新手,它似乎可以正常工作。 It looks like in rbenv you have to run :看起来在 rbenv 中你必须运行:

bundle exec gemxx

Or generate binstubs:或者生成 binstubs:

https://github.com/sstephenson/rbenv/wiki/Understanding-binstubs https://github.com/sstephenson/rbenv/wiki/Understanding-binstubs

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

相关问题 无法使用rbenv安装ruby gems - Failure to install ruby gems with rbenv rbenv bundle install尝试将gem安装到错误的路径中 - rbenv bundle install tries to install gems into wrong path 如何以 root 用户身份安装 rbenv、Ruby、gems 和 Rails - How to install rbenv, Ruby, gems and Rails as root user Rails 3.2不使用捆绑的宝石,Capistrano需要安装sudo gem和rbenv找不到轨道 - Rails 3.2 not using bundled gems, Capistrano needs sudo gem install and rbenv not finding rails gem install使用ruby 1.8.7,rbenv和其他本地gem引发分段错误 - gem install raises segmentation fault with ruby 1.8.7, rbenv and no other local gems rbenv:即使安装了ruby-build,也没有这样的命令“install” - rbenv: no such command “install” even though ruby-build is installed Heroku deplpy 失败并显示“..bin/bundle: line 11: require: command not found... Failed to install gems via Bundler.” - Heroku deplpy fails with '..bin/bundle: line 11: require: command not found... Failed to install gems via Bundler.' Bundle Install命令不会安装我的宝石? - Bundle Install command won't install my gems? 生产中rbenv的乘客设置 - passenger setup for rbenv in production 使用 rbenv 和多个项目随着时间的推移维护 gems - maintaining gems over time with rbenv & multiple projects
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM