English 中文(简体)
无法安装宝石文件吗?
原标题:Not able to install a gem file?

Hi People 我正试图在MAC上通过命令提示安装宝石文件, 使用以下命令“ gem 安装文件名 ” 但每当我试图执行命令时, 我就会收到以下错误

WARNING: Installing to ~/.gem since /Library/Ruby/Gems/1.8 and /usr/bin aren t both writable. WARNING: You don t have /Users/hemmanshu/.gem/ruby/1.8/bin in your PATH, gem executables will not run. ERROR: Error installing frank-cucumber-0.8.14: cucumber requires gherkin (~> 2.10.0, runtime)

每次我试图执行这个命令时 都会出现同样的事情

问题回答

您需要安装具有超级用户权限的宝石, 以便使用

sudo gem install [gemname]

代替

gem install [gemname]

U 试试 Sudo 。 比如“ Sudo 宝石安装文件名 ”

...Most of the time this is a PATH issue, Suppose you are using zshell as me, then add this line at the end of ~/.zshrc file export PATH="$PATH:$HOME/.gem/ruby/2.1.0/bin" If you are using bash as default shell then add this line to end of ~/.bashrc file export PATH="$PATH:$HOME/.gem/ruby/2.1.0/bin"

For your case it will be like this: export PATH="$PATH:$HOME/.gem/ruby/1.8/bin

最后,不要忘记用 source ~/.zshrc 重新装入罐壳,以防z-shell 或 source ~/.bashrc 来重新装入罐壳。 我认为这对某人有帮助 。





相关问题
Ruby parser in Java

The project I m doing is written in Java and parsers source code files. (Java src up to now). Now I d like to enable parsing Ruby code as well. Therefore I am looking for a parser in Java that parses ...

rails collection_select vs. select

collection_select and select Rails helpers: Which one should I use? I can t see a difference in both ways. Both helpers take a collection and generates options tags inside a select tag. Is there a ...

RubyCAS-Client question: Rails

I ve installed RubyCAS-Client version 2.1.0 as a plugin within a rails app. It s working, but I d like to remove the ?ticket= in the url. Is this possible?

Ordering a hash to xml: Rails

I m building an xml document from a hash. The xml attributes need to be in order. How can this be accomplished? hash.to_xml

multiple ruby extension modules under one directory

Can sources for discrete ruby extension modules live in the same directory, controlled by the same extconf.rb script? Background: I ve a project with two extension modules, foo.so and bar.so which ...

Text Editor for Ruby-on-Rails

guys which text editor is good for Rubyonrails? i m using Windows and i was using E-Texteditor but its not free n its expired now can anyone plese tell me any free texteditor? n which one is best an ...

热门标签