Run Rails commands on the Ubuntu terminal

Asked

Viewed 410 times

2

I’m learning Ruby through an Alura course and I have a question.

Every time I want to execute a Rails command, for example startar the server with the command rails server the following error occurs :

bash: /usr/local/bin/Rails: /usr/bin/ruby2.3: invalid interpreter: File or directory not found

To solve this, every time the terminal is opened I run the command below: source /home/wagner/.rvm/scripts/rvm

My question is: Is there any way to automate the execution of the source command /home/wagner/.rvm/scripts/rvm? It’s getting boring having to run it every time the terminal is opened.

1 answer

0


Two things can be done:

Add to your archive ~/.profile or ~/.bashrc:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"

Or the most recommended way, for example in Gnome Terminal:

(PS: Its distribution seems to be in en, I will pass the roads in en, it shouldn’t be hard to find the corresponding path)

Edit -> Profiles Preferences -> Title and Command

There you mark the option:

"Run command as login shell"

And closes and reopens the gnome-terminal again.

Source: Integrating RVM with gnome-terminal

Browser other questions tagged

You are not signed in. Login or sign up in order to post.