我无法在Ruby9上使用任何红宝石宝石

编程入门 行业动态 更新时间:2024-10-28 03:21:16
本文介绍了我无法在Ruby9上使用任何红宝石宝石的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我可以在本地计算机上正常运行gem,但是在Cloud9上,我一直在获取 require:无法加载此类文件。我在使用多个gem时遇到了这个问题,我不知道自己在做什么错。

I get gems to work fine on my local machine, but on Cloud9 I keep getting `require': cannot load such file. I've had this problem with multiple gems and I don't know what I'm doing wrong.

我已经安装了gem,并将其添加到我的gem文件中,捆绑安装。它显示在我的宝石列表中。 这是捆绑包显示中的路径

I have installed the gem, added it to my gem file and did bundle install. It shows in my gem list. Here is the path for it from bundle show

/usr/local/rvm/gems/ruby-2.1.5@rails4/gems/test_linker-1.0.1

这是我的环境路径

GEM PATHS: - /usr/local/rvm/gems/ruby-2.1.5@rails4 - /usr/local/rvm/gems/ruby-2.1.5@global

推荐答案

我有同样的问题。 ENV变量在终端和运行器之间不同步。如果您运行

I had the same issue. The ENV variables get out of sync between the terminal and the Runner. If you run

exec 'env'

$来自ruby脚本的b $ b

,它显示的GEM_PATH和GEM_HOME可能与您在终端上看到的有所不同。

from a ruby script, it may show different GEM_PATH and GEM_HOME than you'll see from the terminal.

要同步它们,我必须从〜/ .profile文件中的env中删除对@ rails4的引用。 (只需将它们在.profile中设置为与跑步者中的内容完全一样。)

To sync them, I had to remove references to @rails4 from env in the ~/.profile file. (just set them in .profile to exactly what they are in the Runner.)

GEM_PATH=/usr/local/rvm/gems/ruby-2.1.4:/usr/local/rvm/gems/ruby-2.1.4@global GEM_HOME=/usr/local/rvm/gems/ruby-2.1.4

此Runner运行不带Rails的ruby脚本。如果需要Rails,则可以基于Ruby on Rails Runner创建运行配置。

This Runner runs ruby scripts without Rails. If you want Rails you can create a Run Configuration based on the Ruby on Rails Runner.

如果您可以更改单个Runner中的ENV变量,那就太好了。右上角有一个ENV按钮,但是尝试覆盖GEM_HOME和路径无效。

It would be nice if you could change the ENV variables in the individual Runners. There is an ENV button at the top right, but trying to override GEM_HOME and path there has no effect.

更多推荐

我无法在Ruby9上使用任何红宝石宝石

本文发布于:2023-10-26 20:42:31,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1531293.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:红宝石

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!