[LINUX] I want to run Rails with rails s even in vagrant environment

environment

Ubuntu 16.04.5 LTS Windows10 Vagrant

procedure

This is fine for running Rails on a Mac environment,

rails s

In the Vagrant environment, commands are troublesome like this.

rails s -b 192.168.33.10 -p 3000

You can search from the history and **! **, but I want to move it more quickly.

history | grep 33.10

Open **. Bashrc ** with ** vi ** and move to the bottom with ** Shift + g **.

vi ~/.bashrc

Add the following function

function rails () {
  if [[ "[email protected]" =~ ^s$ ]]; then
    command rails s -b 192.168.33.10 -p 3000
  else
    command rails "[email protected]"
  fi
}

Reflect the changed .bashrc.

source ~/.bashrc

With ** rails s **, ** rails s -b 192.168.33.10 -p 3000 ** worked.

c'est fini :grin::clap:

Recommended Posts

I want to run Rails with rails s even in vagrant environment
I want to mock datetime.datetime.now () even with pytest!
Environment maintenance made with Docker (I want to post-process GrADS in Python
I want to transition with a button in flask
Even in JavaScript, I want to see Python `range ()`!
I want to work with a robot in python.
I want to run a quantum computer with Python
I want to start a jupyter environment with one command
I want to use a virtual environment with jupyter notebook!
I want to be able to run Python in VS Code
I wanted to delete multiple objects in s3 with boto3
I want to do ○○ with Pandas
I want to debug with Python
I want to improve efficiency with Python even in an experimental system (2) RS232C and pySerial
I want to improve efficiency with Python even in an experimental system (1) Install Anaconda with Chocolatey
I want to solve APG4b with Python (only 4.01 and 4.04 in Chapter 4)
LINEbot development, I want to check the operation in the local environment
I want to detect objects with OpenCV
I want to print in a comprehension
I want to blog with Jupyter Notebook
I want to build a Python environment
I want to pip install with PythonAnywhere
I want to analyze logs with Python
I want to play with aws with python
I want to embed Matplotlib in PySimpleGUI
(Matplotlib) I want to draw a graph with a size specified in pixels
Let's use the NAOqi OS VM. I want to resolve dependencies with pip even in Pepper development
I want to improve efficiency with Python even in an experimental system (3) I want to do something like Excel with Pandas
I want to do Dunnett's test in Python
I want to use MATLAB feval with python
I want to pin Datetime.now in Django tests
I want to analyze songs with Spotify API 2
I want to create a window in Python
I tried to integrate with Keras in TFv1.1
I want to display multiple images with matplotlib.
I want to knock 100 data sciences with Colaboratory
I want to make a game with Python
I want to be an OREMO with setParam!
I want to store DB information in list
Build a Django environment with Vagrant in 5 minutes
I want to analyze songs with Spotify API 1
I want to merge nested dicts in Python
I want to use Temporary Directory with Python2
I don't want to use -inf with np.log
#Unresolved I want to compile gobject-introspection with Python3
I want to use ip vrf with SONiC
I want to solve APG4b with Python (Chapter 2)
I want to start over with Django's Migrate
I want to write to a file with Python
I want to display the progress in Python!
I want to use Python in the environment of pyenv + pipenv on Windows 10
I want to use mkl with numpy and scipy under pyenv + poetry environment
Even beginners want to say "I fully understand Python"
I want to embed a variable in a Python string
I want DQN Puniki to hit a home run
I want to detect unauthorized login to facebook with Jubatus (1)
How to run AutoGluon in Google Colab GPU environment
I want to handle optimization with python and cplex
I want to climb a mountain with reinforcement learning
I want to write in Python! (2) Let's write a test
Settings when you want to run python-mecab with travis