small medium large xlarge

Taichiman_pragsmall
20 Oct 2016, 18:30
Lewis Bogan (4 posts)

First, I realize that this is a beta book and the final will probably be just as good as your last book, Build Awesome Command….

I’m guessing that you are using either Ubuntu or MacOS for developing the book’s application. I use a Vagrant virtualbox guest running CentOS7 for all my development and am having an interesting time following along. I have made it all the way to running ‘foreman’.

Is there any plan to use something like Cloud9 for a place to work out the examples? Or perhaps, package a virtual environment with all the bits preconfigured?

Thanks Lewis

Dmfcb_pragsmall
21 Oct 2016, 01:22
David Copeland (476 posts)

I’m using MacOS and basic UNIX stuff. My hope is that readers are familiar enough with Rails to get a basic Rails dev environment working on their chosen platform.

What’s the issue that you are having? Foreman is a relatively widespread tool so I’m surprised it’s not working on any sort of UNIX-like environment.

In the first edition, the only thing that tripped up Linux users was getting Postgres working, insomuch as a lot of installs for Linux assume a prod server and don’t provide access to some of the tools you need in development.

The second edition has more node/JS stuff in it, but my understanding is that should work as advertised on Linux.

Taichiman_pragsmall
21 Oct 2016, 17:43
Lewis Bogan (4 posts)

I finally made it past foreman and I ‘think’ I have a good development environment.

My first issue was indeed installing and configuring Postgres on Centos7 running on a Virtualbox guest - ok.

Next was making sure that all servers on the vbox guest were bound to 0.0.0.0 instead of localhost - ok. My Procfile:

rails: bundle exec rails server -b 0.0.0.0 -p 3000 webpack: ./node_modules/.bin/webpack-dev-server --config config/webpack.config.js --hot --host 0.0.0.0

The last was making sure all the needed ports were in the Vagrantfile. That’s what killed foreman for me. ‘Hello, world’ from application.js was not showing up in my developer tools section on my browser.

I am building a CentOS7 vagrant package so I can replicate my environment to work with this book. So far, I like it.

Thanks Lewis

Generic-user-small
11 Nov 2016, 17:40
Octave Antoni (3 posts)

Is the app feasible with a classic Vagrant rails-dev-box ? This post is the only reason I hesitate buying the book

I don’t want to spend more time setting up my environnement than actually developping

Dmfcb_pragsmall
13 Nov 2016, 15:24
David Copeland (476 posts)

It is vanilla rails setup as far as I can tell, assuming you are able to install Postgres or set up one that you can access from your Vagrant box

Webpack requires running a dev server locally that is accessible on a given port on localhost. My guess is that this is the problem on Cloud 9 and that since Cloud 9 doesn’t run things on localhost, the webpack-dev-server needs to be configured in a different way.

Generic-user-small
07 Dec 2016, 22:12
Art Mills (4 posts)

I am running on Cloud 9 and it took forever for me to figure out how to get things going. I went to Vagrant and kind of got it going there though it took some doing too as the whole Windows/symlink thing was difficult using Oracle Virtualbox.

On Cloud 9 you are effectively running “in production” even in development.

As such you need to add the following line to your development.rb file:

config.webpack.dev_server.enabled = false

Then, each time you want to see something work in production you actually have to run to compile everything in public/webpack:

rake webpack:compile

Once that’s done, run foreman start -f Procfile.dev and that file should look like this:

# Run Rails & Webpack concurrently
# Example file from webpack-rails gem
rails: bundle exec rails server -b $IP -p $PORT
webpack: ./node_modules/.bin/webpack-dev-server --config config/webpack.config.js --host $IP --port $PORT

With these changes I can, I think, use Cloud 9. Vagrant I wound up getting to work by simply doing a global npm install of webpack-dev-server then changing the Procfile to point to the directory it was in instead of the one it wasn’t in within my project for whatever reason.

Generic-user-small
05 Jan 2017, 15:26
Laura (40 posts)

I wonder if you made it work on Cloud9. I didn’t regards Laura

You must be logged in to comment