Run any Ruby or Rails command without need to install them locally.
This utility is under active development. Some commands and options may change in a time.
$ curl -s https://raw.githubusercontent.com/zinovyev/dru/master/dru | sudo sh -c 'cat > /usr/bin/dru && chmod +x /usr/bin/dru'
$ dru update
Run a docker container with the latest alpine ruby image
$ dru shell
/usr/src # ruby -v
ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-linux-musl]
Run the irb shell
$ dru irb -t '2.7-rc-slim'
irb(main):003:0> RUBY_VERSION
=> "2.7.0"
Create a new 6.0.0.rc1 Rails project in the current directory...
$ dru rails -r '6.0.0.rc1' -e 'new . --database=postgresql'
$ ls
app bin config config.ru db Gemfile Gemfile.lock lib log package.json public Rakefile README.md storage \
test tmp vendor
...and then initialize a docker-compose project for a local development
$ dru project
$ ls
app bin config config.ru db docker-compose.yml Dockerfile Gemfile Gemfile.lock lib log package.json \
public Rakefile README.md storage test tmp vendor
dru shell Runs sh in ruby conainer
dru irb Runs irb in ruby conainer
dru rails Runs rails command in the container
dru project Generate Dockerfile and docker-compose.yml files
dru update Updates dru to the latest stable release
dru uninstall Removes dru from your machine
-d or --dir Mount directory (default: current directory)
-t or --tag Tag of ruby image (default: alpine)
-e or --exec Execute a custom command in the container