I think iTerm2 has much nicer keyboard shortcuts than tmux, because you don’t need to use a prefix key. I have to stretch my hand too far for Ctrl+b, and Ctrl+a kind of hurts my wrist. I couldn’t find a nice “prefix key” for the keyboard shortcuts. It’s also great for developers who use vim or emacs. This runs each process in a different pane or window, so you can use binding.pry to debug your code. A configuration file looks like this: windows: Tmuxinator sets up different tmux panes and windows to run all of your processes. I often use pry-byebug to debug my code by calling binding.pry, and the IRB prompt doesn’t work properly when you’re using foreman. The problem is that you can’t use a debugger. Runing foreman start will start the processes: $ foreman startġ2:38:24 worker.1 | started with pid 46747ġ2:38:24 client.1 | started with pid 46748 You create a Procfile with all of the commands that you need to run: web: bundle exec rails server -binding=127.0.0.1 -p 3000Ĭlient: cd client & yarn run build:development Other Options Foremanįoreman is another popular choice. It’s a better default as tests will then not mistakenly come to rely on behavior happening synchronously. Active Job’s default adapter was also changed from :inline to :async in Rails 5: It’s always better if you can run the same code in development and production. However, you might end up missing some bugs and edge cases that are related to asynchronous behavior. The advantage is that you can just run rails server, instead of starting multiple processes. If you’re only using Rails and Sidekiq, you might be tempted to run your Sidekiq jobs “inline” during development: require 'sidekiq/testing' Tell current session of new_tab to write text "cd " & current_dir # Open some extra tabs for git, rspec, deploys, etc. Set new_tab to create tab with default profile # Only open some more tabs if this is a new window Write text "cd " & current_dir & "/client" Set client_session to split vertically with default profile Set sidekiq_session to split horizontally with default profile Write text "bundle exec rails server -binding=127.0.0.1 -port 3000" Open a few extra tabs for things like git, rspec, deploys, etc.Start webpack in a new pane on the bottom right.Start sidekiq in a new pane on the bottom left.Start rails server in the current session.dev.scpt script with the current directory as an argument. I’ve also added a ds alias to my ~/.bashrc so that I can run them quickly: alias ds='osascript. dev.scpt scripts in the root folder of my projects. It also has very good AppleScript support, so you can write a script that sets up some panes and tabs, and starts some processes. ITerm2 is an excellent terminal emulator for Mac that supports tabs and panes. You’ll probably also want to have a Rails console. You might need to run rails server, sidekiq to process background jobs, and webpack to compile your front-end code. A Rails developer often needs to start multiple processes while working on an application.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |