简体   繁体   中英

Can't use 'rails' command after installing using gem install

I've installed rails using 'gem install rails', but when I try to create a new project, I get the error: The program 'rails' is currently not installed. You can install it by typing:

sudo apt-get install rails

There were no error messages when I ran 'gem install rails'. How come I cannot run rails commands?

When I do sudo apt-get install rails, it will install an older version of ruby, 1.8. I want the newest, so I do not want to install rails from apt-get.

Edit: Figured it out. Had to add PATH="${PATH}:/var/lib/gems/1.8/bin/" to .bashrc

The command for rails is not 'gem rails' it is just 'rails'

To install rails:

gem install rails

To create a new rails application

rails myapp

重新启动计算机,有时在我的Ubuntu上会发生这种情况,我有99%的时间需要重新启动

The command for rails is not 'gem rails' it is just 'rails'

To install rails:

gem install rails To create a new rails application

rails new myapp

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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