Reputation: 4728
I just downloaded an app code from github and when I am trying to run the command rails s
, I am getting this error -
The program 'rails' can be found in the following packages:
* rails
* ruby-railties-3.2
This is specific to this app only, can someone tell me how to fix this ? I am using RVM
Upvotes: 16
Views: 14395
Reputation: 470
I have use /bin/bash --login
for my ubuntu on raspberry pi after getting the same error. It's working right now.
Upvotes: 1
Reputation: 13347
In case anyone else has this problem, but the above doesn't work. Try running:
/bin/bash --login
then run
rvm use 2.0.0 #or whatever your version number is...
Upvotes: 20
Reputation: 5651
Not really sure what exactly your problem is. If you use rvm and have installed Rails with it, you may have to use
rvm use 1.9.3
(version number may depend on your installation). Then you may or may have not a gemset with this. So:
bundle install
should install Rails gem in this gemset. Maybe use
rvmsudo bundle install
or just manually install the Rails gem. But this would partially depend on the Rails version expected by the app. There are other options, but this should mostly work.
For setting a version permanently you can use:
rvm use 1.9.3 --default
For this to work you must have something like this:
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
in your ~/.bash_profile.
In addition you can have something like a .rvm folder in your project where you can set rvm options on a project level if you need to switch between versins often (didn't use this myself, but there should be docs on the rvm homepage)
Upvotes: 10