简体   繁体   English

找不到rails-3.2.6的可执行rails

[英]can't find executable rails for rails-3.2.6

When trying to run 'rails s' I get the following error? 尝试运行'rails s'时出现以下错误?

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:334:in `bin_path': can't find executable rails for rails-3.2.6 (Gem::Exception) from /usr/bin/rails:19 /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:334:in`bin_path':找不到rails-3.2.6的可执行rails(Gem ::例外来自/ usr / bin / rails:19

I am using RVM and I am sure I installed it in the incorrect location. 我正在使用RVM,我确信我将它安装在错误的位置。

If you install via RVM, then, that message will never appear, because it's the message emitted by the ruby which come with OS X, which probably invoked by /usr/bin/rails. 如果你通过RVM安装,那么,该消息将永远不会出现,因为它是OS X附带的ruby发出的消息,可能由/ usr / bin / rails调用。

I guess you installed RVM and ruby, but not rails via RVM. 我猜你安装了RVM和ruby,但不是通过RVM安装了rails。 Assuming you're using 1.9.3-p194, you must: 假设您使用的是1.9.3-p194,则必须:

% rvm 1.9.3-p194

then, run 然后,跑

% gem install rails

now, run which rails , It should show the rails's path somehere beneath ~/.rvm . 现在,运行which rails ,它应该在~/.rvm下面显示rails的路径。 in my case: 在我的情况下:

% which rails
/Users/shigeya/.rvm/gems/ruby-1.9.3-p194/bin/rails

If it is not, check your path variable. 如果不是,请检查路径变量。 You may also re-login to set PATH correctly, if you just installed ruby and RVM. 如果刚刚安装了ruby和RVM,您也可以重新登录以正确设置PATH

The above worked and I also did the following (exactly no misspellings): 以上工作,我也做了以下(完全没有拼写错误):

rvmsudo gem install rails
rvmsudo gem install bundler
rvmsudo rubygems current

rvm gemset create rails31
rvm use 1.9.3p194@rails31 --default
rvm --rvmrc --create use 1.9.3-p194@uxolo

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

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