Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to start rails console on my ubuntu server

I'm debugging an issue with a rails app on my ubuntu server and i'm trying to start the rails console to run a command, but this is what happens when I try to start the console:

myuser@rails-server1:/var/www/myapp/current$ rails c
The program 'rails' can be found in the following packages:
 * ruby-railties-3.2
 * ruby-railties-4.0
Try: sudo apt-get install <selected package>

Rails is definitely installed because my app is running and the gem is installed in this dir:

/var/www/myapp/shared/bundle/ruby/2.0.0/gems

So how can i actually start the rails console?

like image 230
Catfish Avatar asked Dec 31 '25 21:12

Catfish


1 Answers

bundle exec to the rescue:

$ bundle exec rails console
like image 185
Catfish Avatar answered Jan 03 '26 12:01

Catfish



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!