{"id":15580791,"url":"https://github.com/brunofacca/rails-development-environment","last_synced_at":"2025-06-21T04:08:25.084Z","repository":{"id":65988148,"uuid":"68926061","full_name":"brunofacca/rails-development-environment","owner":"brunofacca","description":"Development environment for Ruby on Rails based on Vagrant, VirtualBox and Ubuntu 16.04 LTS (Xenial Xerus).","archived":false,"fork":false,"pushed_at":"2017-09-12T11:46:49.000Z","size":39,"stargazers_count":49,"open_issues_count":0,"forks_count":7,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-24T02:03:47.040Z","etag":null,"topics":["development-environment","linux","rails","ruby","ubuntu","vagrant","virtualbox"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brunofacca.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-09-22T13:51:59.000Z","updated_at":"2025-02-20T10:36:55.000Z","dependencies_parsed_at":"2023-05-14T16:00:45.116Z","dependency_job_id":null,"html_url":"https://github.com/brunofacca/rails-development-environment","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/brunofacca/rails-development-environment","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brunofacca%2Frails-development-environment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brunofacca%2Frails-development-environment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brunofacca%2Frails-development-environment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brunofacca%2Frails-development-environment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brunofacca","download_url":"https://codeload.github.com/brunofacca/rails-development-environment/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brunofacca%2Frails-development-environment/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261060154,"owners_count":23103985,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["development-environment","linux","rails","ruby","ubuntu","vagrant","virtualbox"],"created_at":"2024-10-02T19:40:21.381Z","updated_at":"2025-06-21T04:08:20.058Z","avatar_url":"https://github.com/brunofacca.png","language":"Shell","readme":"# Zen Rails Development Environment\n\n## Summary\nDevelopment environment for Ruby on Rails based on Vagrant, \nVirtualBox and Ubuntu 16.04 LTS (Xenial Xerus). \n\nThe Vagrant provisioning scripts do the following:\n- Set the VM locale and time zone.\n- Configure the VM for SSH access with a custom SSH key.\n- Use RVM to install any version of Ruby and Rails in the VM.\n- Install PostgreSQL, configure it to listen on 0.0.0.0, create a new user \ncalled `ubuntu` with password `localdbpass` and grant it CREATEDB permissions.\n- Install MySQL, configure it to listen on 0.0.0.0 and set the password of \nthe `root` user to `localdbpass`.\n- Install Yarn, Rails' official Frontend package manager as of Rails 5.1.\n- Install and configure Git at the VM.\n- Install Elastic Beanstalk CLI at the VM.\n- Install Heroku CLI at the VM.\n- Install [Selenium Webdriver](http://docs.seleniumhq.org/projects/webdriver/), \n[ChromeDriver](https://sites.google.com/a/chromium.org/chromedriver/), and\n[Xvfb](https://www.x.org/archive/X11R7.7/doc/man/man1/Xvfb.1.xhtml). These \nallow the execution of JavaScript-enabled tests on Minitest or RSpec (with\n [Capybara](https://github.com/teamcapybara/capybara)) using headless Google \n Chrome.\n\nOther scripts run at shell startup to set environment variables and Bash\nshortcuts (aliases and functions).\n\n## Installation\n1. Install the latest version of Vagrant and VirtualBox on the host machine.\n2. Choose a directory for your VirtualBox shared folder (in the host machine).\n[Download this repository][1] and unzip it inside the chosen directory.\n3. Create an SSH key pair, name the files `id_rsa` (private key), `id_rsa.pub`\n(public key), and place them in the `vm_provisioning` directory.\n4. Edit the `Vagrantfile` in order to customize the values of the variables\nlocated in the \"User Configurations\" section.\n5. Optional: If you require any custom environment variables to be available at\nthe guest VM, create a file named `environment_variables.sh` within the\n`vm_provisioning` directory and set your environment vars using the standard\nbash syntax: one `export VAR_NAME='var value'` declaration per line. Those vars\nwill be loaded automatically every time the VM boots. That is a good place to\nstore your API keys and other secrets.\n6. Optional: If you wish to use any custom bash aliases or functions, add them\nto `bash_shortcuts.sh`\n7. Optional: If you intend to use Selenium and Chrome headless with Capybara\n and RSpec, add the following to `spec/rails_helper.rb`:\n\n       require 'selenium-webdriver'\n\n       Capybara.register_driver :selenium do |app|\n         options = Selenium::WebDriver::Chrome::Options.new\n         # The window size is important for screenshots\n         options.add_argument \"--window-size=1366,768\"\n         Selenium::WebDriver::Chrome.driver_path = \"/usr/local/bin/chromedriver\"\n         Capybara::Selenium::Driver.new(app, \n                                        browser: :chrome, \n                                        options: options)\n       end\n\n[1]:\nhttps://github.com/brunofacca/rails-development-environment/archive/master.zip\n\n## Files and their purposes\n\n| File                     | Contents and/or purpose                                                                                                                                                                         | Executed at             | Called by                 |\n|--------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------|---------------------------|\n| bash_shortcuts.sh        | Custom bash aliases and function definitions.                                                                                                                                                   | \"Login\" (shell startup) | Symlink at /etc/profile.d |\n| environment_variables.sh | Custom environment variable definitions. You may store your  API keys and other secrets here, as long as you keep this file  outside any Git repositories.                                      | \"Login\" (shell startup) | Symlink at /etc/profile.d |\n| boot.sh                  | Custom startup commands. These commands were not inserted  in rc.local because: a) we prefer Bash over Bourne Shell; b) the  -e flag used in rc.local's shebang line causes undesired behavior. | VM boot                 | /etc/rc.local             |\n| custom_rc_local.sh       | Custom rc.local. Waits for the Vagrant shared folder to be mounted and executes the custom boot script (`boot.sh`).                                                                             | VM boot                 | Installed by provision.sh |\n| provision.sh             | Installs and configures everything in the VM, except Ruby and Rails.                                                                                                                            | VM provisioning         | Vagrantfile               |\n| install_ruby.sh          | Installs Ruby and Rails in the VM at the end of provisioning.                                                                                                                                   | VM provisioning         | Vagrantfile               |\n| Vagrantfile              | General configurations. Set up the VirtualBox VM and the provisioning process.                                                                                                                  | vagrant up, halt, etc   | the user                  |\n\n## Usage\n\ncd to the directory where the Vagrantfile is (in the host machine) and run:\n- `vagrant up` to start the VM;\n- `vagrant ssh` to access the VM via SSH;\n- `vagrant halt` to turn off the VM;\n\nYou can also access the VM via SSH by connecting to port 2222 of the host\nmachine with your favorite SSH client, using the private key specified in the\n`ssh_private_key` variable of the Vagrantfile.\n\n**Shortcuts**\n\nAll shortcuts except `jcurl` only work when executed within a Rails app\ndirectory.\n\n`rs` rails s -b 0.0.0.0  \n`rc` rails console\n\n`br` bin/rspec. Use within the Rails application folder to run RSpec with \nSpring.  \n`brfd` bin/rspec --format documentation \n\n`tdl` tail -f development log  \n`ttl` tail -f test log  \n`ctl` clear test log  \n`cdl` clear development log  \n\n`jcurl` runs curl -s and pretty prints JSON output with the awesome_print gem.\nTakes a URL as an argument.\n\n`bi` Run bundle install in multiple parallel threads (faster).\n\n`gpl` git pull  \n`ga` git add  \n`gc` git commit. Takes a commit message as an argument.  \n`gp` git push. Takes a remote name and a branch name as optional arguments\n(e.g., origin master)       \n`gs` git status  \n`gl` git log\n\n## Contributing\n\n**Bug reports**\n\nPlease use the issue tracker to report any bugs.\n\n**Developing**\n\n1. Create an issue and describe your idea\n2. Fork it\n3. Create your feature branch (git checkout -b my-new-feature)\n4. Commit your changes (git commit -m 'Add some feature')\n5. Publish the branch (git push origin my-new-feature)\n6. Create a Pull Request\n\n## License\n\nReleased under the [MIT License](https://opensource.org/licenses/MIT).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrunofacca%2Frails-development-environment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrunofacca%2Frails-development-environment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrunofacca%2Frails-development-environment/lists"}