切换到zsh会破坏命令行中的rails [英] Switching over to zsh breaks rails in command line

查看:52
本文介绍了切换到zsh会破坏命令行中的rails的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近刚切换到在oh-my-zsh中使用zsh,但是在使用rails命令行工具时遇到了问题。这是我执行的步骤以及收到的错误。

I just recently switched over to using zsh with oh-my-zsh and I am having issues using the rails command line tool. Here are the steps that I ran through, and the error that I am receiving.

我运行了github页面提供的curl命令:

I ran the curl command that the github page provides:

curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh

然后我去运行rails,这是我收到的以下错误消息:

Then I went to run rails s, this is the following error message that I receive:

.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find railties (>= 0) amongst [bigdecimal-1.1.0, io-console-0.3, json-1.5.4, minitest-2.5.1, rake-0.9.2.2, rdoc-3.9.4] (Gem::LoadError)

这似乎是我遇到了gem错误所以我没有解决问题就重新安装了rvm,rails和bundler。但是,如果我将终端切换回bash,则没有任何问题,并且rails可以正常工作。还有其他人遇到类似的问题吗?我想使用zsh,因为它似乎具有更好的功能,但是如果我不能使用rails,则必须将其转储到路边。

This looks like I am having a gem error so I reinstalled rvm, rails and bundler with nothing solving the issue. However if I switch my terminal back over to bash then I dont have any issues and rails works perfectly fine. Has anyone else run into a similar issue? I want to use zsh because it seems like it has better features but if I can't use rails then I have to dump it to the curb.

这些是我的.zshrc文件末尾的行:

These are the lines at the end of my .zshrc file:

export PATH=/Users/thomascioppettini/.rvm/gems/ruby-1.9.3p0/bin:/Users/thomascioppettini/.rvm/gems/ruby-1.9.3-p0@global/bin:/Users/thomascioppettini/.rvm/rubies/ruby-1.9.3-p0/bin:/Users/thomascioppettini/.rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/X11/bin

PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting


推荐答案

好,我通过删除zshrc中设置的路径并复制rvm行使其工作从我的bash_profile中获取,以便从rvm获得正确的配置。如果您在终端中运行以下命令,则它应该可以正常工作:

Ok I got it to work by deleting the path that was set in the zshrc and copying the rvm lines from my bash_profile in order to get the right configuration from rvm. If you run the following command in your terminal it should work:

cat ~/.bash_profile >> ~/.zshrc

这篇关于切换到zsh会破坏命令行中的rails的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆