Giter VIP home page Giter VIP logo

rails-5-jade's People

Contributors

lcreid avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

rails-5-jade's Issues

Webkit (e.g. for Capybara)

If we're going to use Webkit for a JavaScript driver, we also need to do this:

sudo apt-get install libqtwebkit-dev gstreamer1.0-plugins-base gstreamer1.0-tools gstreamer1.0-x
sudo apt-get install xvfb

The last line installs a thing that starts a hidden X11 server, needed by webkit. There is a headless gem that helps use this X11 server, but I haven't figured it out yet.

Clock on box drifts

The clock on the rails5 box drifts from real time. Perhaps this is because I haven't set up NTP for it.

I wonder if this is what causes the problem that we've observed that long-running boxes lose the ability to automatically identify when files have changed?

Refactor builds to cover development and production

We have a variety of environments to support:

  • A Vagrant box with Postgres client and server for development and testing
  • A Vagrant box with MS SQL Server client and server for development and testing
  • An Ubuntu server with Postgres client only for staging or production
  • An Ubuntu server with MS SQL Server client only for staging or production
  • We'll always have to support at least two versions of Ubuntu, because there's always overlap when you want to support existing versions and do new work on the next version
  • Other providers (e.g. VMware, Docker)

One of the challenges with other providers is that the Ubuntu preseed.cfg script we use for Vagrant sets up the default user to be vagrant, which while not unusable, might seem a bit strange in other environments (AWS or other cloud images, or other local virtualization solutions). We also install some things that we don't really need to, because they have to be set up in the script for the production environments.

Another part of this is the organization and naming of the project/repository.

In some cases we need a Bash script that we run on an existing image. In other cases we want to build an image with Packer and run the same scripts and others on that image.

New Postgres Project Could be Smoother

Typically, to start a new project we want to do:

rails new --database=postgresql --skip-coffee .

This creates a config/database.yml that doesn't match the docs. It would be nice to harmonize the docs and the build so that building a new project was easier.

Move Postgres data files to /vagrant directory

When we upgrade a box, we lose all the Postgres data files. For a development box, that's not a big problem, but it would be nicer if the Postgres data files were in /vagrant somewhere, like /vagrant/db.

Update installed gems when upgrading box

When upgrading versions of the box, you lose a bunch of the installed gems, and often they need to be updated anyway, for example, when the new box brings a new version of Rails.

Many of the thoughts in the second comment on Issue #5 apply here.

MS SQL needs simple database recovery mode.

The model database is in FULL recovery mode, which means all databases created are also in FULL recovery mode. This means the database log files grow forever, and eventually the Vagrant box runs out of space.

In the initial build, we need to do something like:

ALTER DATABASE model SET RECOVERY SIMPLE;
go

The following answer says what to do when your log is big: https://stackoverflow.com/a/18292136/3109926

Stricter versioning of gems.

In the case of Bundler, leaving the gem version too flexible has caused quite a bit of grief lately, due to changes in the binstubs generated by Bundler. Since the binstubs are generated on the development box, care must be taken to ensure that Bundler is the same version on the development box as on the production box (or UAT or any other environment).

This may well apply to some of the other gems as well.

Discontinue this Project?

As of Ubuntu 20.04, Multipass is standard. It's also supported on Mac and Windows. It looks like a lot smoother way to manage multiple local dev instances.

Big question: If we're going to move away from the Vagrant platform, is Multipass the right way to do it? What about Docker? (I don't like what I'm hearing about Docker, but Mulitpass is new so it's likely to have its haters in a few years, too.)

Provide a template for Rails new.

Some of the stuff that's installed in the base box arguably doesn't belong there. A Rails application template such that a rails new on the box generated the right Gemfile might be more appropriate. This might supersede #26 and #25.

Non-default Background for Terminal Window

Make the terminal window a non-default colour so it's easier to see which window you're in. This benefits Ubuntu users mostly, because I assume the Mac will look different anyway.

Rails 5.1

Need a box for Rails 5.1. It sounds like there are sufficient changes with 5.1 that I should create a new base box on Atlas.

Upgrade Chrome on Boxes

Testing with headless Chrome is broken, until you do sudo apt update && sudo apt upgrade. The boxes should be upgraded to a newer version of Chrome.

Base box needs 1 GB of RAM

Increasing the RAM on the machine to 1 GB made tests run more reliably on one project. If this shows up for other people, make the base box have 1 GB RAM.

Rails Needs Config Change for Server to See File Changes

You have to comment out one line and put another near the end of config/environments/development.rb for each Rails project you do in the Vagrant machine:

# config.file_watcher = ActiveSupport::EventedFileUpdateChecker
config.file_watcher = ActiveSupport::FileUpdateChecker

rails-jade-18-04-pg + windows = errors in "file provisioner"

Hi,
The host is win7 with the latest virtualbox and vagrant (also tested on win10). Simply running the commands:

vagrant init jadesystems/rails-jade-18-04-pg
vagrant up

results in:

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
There are errors in the configuration of this machine. Please fix
the following errors and try again:

File provisioner:
* File source must be specified.
* File upload source file C:/Users/<USER NAME HERE>/.gem/credentials must exist

Can't figure out why but the older box works as expected (rails-5-2).

Thanks!

Use rbenv

For people who are deploying to shared servers, they still need to version their Ruby. So this box should come with rbenv and the latest Ruby, but allow users to install previous Rubies.

This brings up a few questions:

  • Should we pre-install a few of the recent, supported versions of Ruby?
  • Some versions of gems are incompatible with some versions of Linux, e.g. json (and the net says libxml is often a culprit). So complete portability of apps may be a challenge. That probably means don't knock yourself out to try to solve the whole problem
  • Do we need to worry about installing gems locally? rbenv probably does that
  • How much does this change how we issue commands? Do we have to bundle exec in front of everything?
  • What implications does this have for our deploy scripts?

We're going with rbenv rather than rvm because rbenv is less intrusive, and Bundler provides what rvm provides that rbenv doesn't.

Time synchronization

To adjust the NTP server on a server running timedatectl, edit /etc/systemd/timesyncd.conf.

Rails doesn't detect file changes and config.reload_classes_only_on_change makes the server too slow

Hi,

First of all I don't know if this is a bug or not. Until now I've been using this command in rails development.rb environment config so the box detects changes on my files:

config.reload_classes_only_on_change = false

But now, with Rails 5.2 and Active Storage that command makes the server a lot slower, and the images takes from 10 to 40sec to load.

Is it a bug? There is another way to make the vagrant/rails detect changes on my files without making me reload the server every time I change something?

Hope you can help me!
Best regards

Make sure box is cleaned and compressed as much as possible

v0.2.0 is 1.5 GB. Supposedly if you zero all the free space after you install and then clean up, you can get better compression of the box. It's not clear to me whether Packer does this for you.

Investigate, and implement myself if it isn't done.

`dpkg` fails installing headers

The upgrade or (more likely) dist-upgrade at the end of the build gives these messages:

virtualbox-iso: Unpacking linux-headers-4.4.0-77 (4.4.0-77.98) ...
virtualbox-iso: E: Sub-process /usr/bin/dpkg exited unexpectedly
virtualbox-iso: E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
virtualbox-iso: Successfully installed i18n-0.8.1

Then any attempt to install software fails, and you have to do:

sudo dpkg --configure -a
sudo apt-get install -f

Webpacker doesn't work when Virtualbox host is Windows (Rails 6)

When attempting to use Webpacker (typically with Rails 6), if the Virtualbox host is Windows, Webpacker (actually Webpack) will fail with: EPROTO: protocol error, symlink.... This happens for all new projects created by Rails 6, and probably happens for other projects that use Webpacker.

Ubuntu 20.04

Daily builds are out, so I could start working on the Ubuntu 20.04 version of this build.

Error: SSL certificate problem: unable to get local issuer certificate

User reported "Error: SSL certificate problem: unable to get local issuer certificate" when bringing up a box. http://stackoverflow.com/questions/32937994/vagrant-up-not-working-on-windows describes one possible cause and a couple of fixes.

There are a number of reports of this symptom on the Internet. It seems like people's certificate authorities/chains/whatever change often enough that people run into grief with the fact that vagrant downloads stuff over HTTPS.

Puma won't start I think..?

Hi,
I'm getting a problem with a new project that I created using your box. I follow your instructions but when I start my rails server and I go to my browser at: localhost:3000 there is no "Welcome Aboard" page. It seems that the Puma won't start, I think.

I'll tell you what I did step by step and I hope you can help me:

  • Created a dir with my project name;
  • Enter my project folder;
  • Created a vagrantfile:
Vagrant.configure("2") do |config|
  config.vm.box = "jadesystems/rails-5-2"
  config.vm.box_check_update = true

  config.vm.provider "virtualbox" do |v|
    v.linked_clone= true
    v.cpus= "1"
    v.memory = "2048"
  end
end
  • The inside my project folder I enter git bash:
vagrant up
vagrant ssh
cd /vagrant
rails new . --database=postgresql --skip-coffee
  • After that I started the server
vagrant@rails-5-2:/vagrant$ rails server
=> Booting Puma
=> Rails 5.2.3 application starting in development
=> Run `rails server -h` for more startup options
Puma starting in single mode...
* Version 3.12.1 (ruby 2.5.1-p57), codename: Llamas in Pajamas
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://localhost:3000
Use Ctrl-C to stop

It seems everything ok but when I go to my browser and I put localhost:3000 it tells me that this site can't be reached.

I tried also to start the server like you have, but it gives me an error:

vagrant@rails-5-2:/vagrant$ rails server --bind 0.0.0.0
Traceback (most recent call last):
        28: from bin/rails:3:in `<main>'
        27: from bin/rails:3:in `load'
        26: from /vagrant/bin/spring:15:in `<top (required)>'
        25: from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:70:in `require'
        24: from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:70:in `require'
        23: from /var/lib/gems/2.5.0/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `<top (required)>'
        22: from /var/lib/gems/2.5.0/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `load'
        21: from /var/lib/gems/2.5.0/gems/spring-2.0.2/bin/spring:49:in `<top (required)>'
        20: from /var/lib/gems/2.5.0/gems/spring-2.0.2/lib/spring/client.rb:30:in `run'
        19: from /var/lib/gems/2.5.0/gems/spring-2.0.2/lib/spring/client/command.rb:7:in `call'
        18: from /var/lib/gems/2.5.0/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in `call'
        17: from /var/lib/gems/2.5.0/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in `load'
        16: from /vagrant/bin/rails:9:in `<top (required)>'
        15: from /var/lib/gems/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
        14: from /var/lib/gems/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
        13: from /var/lib/gems/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require'
        12: from /var/lib/gems/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
        11: from /var/lib/gems/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
        10: from /var/lib/gems/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
         9: from /var/lib/gems/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
         8: from /var/lib/gems/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
         7: from /var/lib/gems/2.5.0/gems/railties-5.2.3/lib/rails/commands.rb:18:in `<top (required)>'
         6: from /var/lib/gems/2.5.0/gems/railties-5.2.3/lib/rails/command.rb:46:in `invoke'
         5: from /var/lib/gems/2.5.0/gems/railties-5.2.3/lib/rails/command/base.rb:65:in `perform'
         4: from /var/lib/gems/2.5.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
         3: from /var/lib/gems/2.5.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
         2: from /var/lib/gems/2.5.0/gems/thor-0.20.3/lib/thor/command.rb:20:in `run'
         1: from /var/lib/gems/2.5.0/gems/thor-0.20.3/lib/thor/command.rb:34:in `rescue in run'
/var/lib/gems/2.5.0/gems/thor-0.20.3/lib/thor/base.rb:506:in `handle_argument_error': ERROR: "rails server" was called with arguments ["0.0.0.0"] (Thor::Invoc
ationError)
Usage: "rails server [puma, thin etc] [options]"

I hope you can help me. Thank you in advance.

`.netrc` in Vagrant Box

Chandler requires your GitHub credentials in ~/.netrc. One thing might be to provision the box's ~ with .netrc that contains /^machine +api\.github\.com/,//+2 from the host. Another possibility: figure out how to capture the credentials the first time, and store them in ~/.netrc.

Build for other providers.

It would be nice to have a VMware and Qemu/KVM builder at least.

Some of the challenges:

  • Vagrant defaults to a particular user name on the box, which is built in to the Ubuntu seed file
  • There are variants of builds that don't depend on the platform. For example, a build to use MS SQL as the database
    • Maybe just be careful not to get side-tracked by this one
  • We also have to support at least two versions of LTS at a time

Use nodejs from PPA for 18.04

The version of nodejs from the Ubuntu distro is too old for Webpacker at this point. Try installing Nodejs 10.x from a PPA.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.