Roots example project - issue with updating unusable path

I’m throwing myself in at the deep end and trying out the complete Roots set up with the example project. As per the instructions, I’ve done this via Terminal to get the latest files (and to learn the process). I’m stuck at (from the read me) updating the ansible path:

File.join(__dir__, 'ansible')

This throws back:

-bash: syntax error near unexpected token `__dir__,'

I’ve read everything I can find on this, but I’m none the wiser as to why I’m getting this error. Can anyone explain? Thanks in advance.

Code in the Vagrantfile is Ruby code. Typing in the terminal is Bash. They’re not the same

__dir__ is the same in PHP as in Ruby, it gives you the current directory of the file. File.join() allows you to append a folder or file onto it without worrying about concatenating strings or worrying about OS differences.

Hi, thanks for the reply,

To clarify, I am quoting from the read me file, which says:

5. Move `Vagrantfile` to root: `$ mv ansible/Vagrantfile .` and update the [ANSIBLE_PATH]( to `File.join(__dir__, 'ansible')`

Perhaps I should start again with the question. It’s not clear to me what to do at this step of the read me file. The first part - moving the file has worked OK, it’s the second part (the File.join bit) that is giving the syntax error. The rest of the steps are in Termina, so I’d assumed I added it here. Are you saying I should be adding this somewhere else? If so, can you help clarify? Thanks.

It’s not a terminal command. You need to update the following line of the Vagrantfile:

Line 9? OK, that works, thanks!

The Roots example read me clearly needs clarification on this point. I’ve found other things needing a bit clarity (it feels like I’m hacking through a jungle with a machete and an inaccurate hand drawn map :-), but I’ll make a separate post about that. Thanks for your help!

Feedback about our instructions is always wanted so please do publish what you had problems with :smile:

OK, cool. Well I haven’t managed a fully working Bedrock/Sage install yet.

Basically, following the read me up until the point mentioned above (currently step 5) went quite well.

The update Ansible path should be step 6 and a little clearer that you are editing the vagrant file itself :smile:

I think the main thing is that after that step , many errors occurred. Partly because things were not preinstalled. Like a recipe, perhaps these should be listed at the top of the doc in a ‘Before you start’ area. These were:

  1. Virtual Box. Vagrant will not run without this, but there’s no mention in your doc (yet)
  2. Vagrant host updater. I have no idea about this yet (I have about 30 browser tabs open and a lot of reading to do)
  3. Ansible Playbook. I('m still not sure if I have this set up right, I used: 'vagrant plugin install ansible-playbook'). Step 1. of your Staging/Production bit fails without this.

It really falls down at Sage/Theme step 3: $ cd /srv/www/ && composer require roots/soil Is this supposed to be replaced with my local path? I haven’t really managed to get any further.

I did a previous Sage install, so I’m familiar with this part, but with the different file paths, it’s not the same. I can’t work out how to view the site. Does Virtual Box create a virtual server to work with browser sync? If so, what’s the address or how do I find it?

I hope the above helps. For the record, I’m a front end developer, so most of the components of Sage and Bedrock are entirely new to me. All the respective components make for a massive learning curve. I built a site with Sage and despite the unfamiliar (non-Wordpress standard) complexity of the folder paths, I can see where the benefits lie (although I got it working and it broke down and I spent 12 hours troubleshooting an issue that was only resolved by brutally deleting a folder and reinstalling). The benefits to me are mostly in precompiling SASS and browser sync. I managed to make the theme really quickly and efficiently (although this was my first Sage install and it took ages to do, eating into a lot of production time). Anyway, my main comment is these things are a complete bstrd to set up if your more used to the front end stuff, but when up and running there are real benefits (and quite fun to work with). If I can further help improve the (currently painful) setting up part, by sharing insight on the experience, let me know.

If you can shed any light on how I can complete the Bedrock installation too, I’d be most grateful.

I’ll give this a better read later, but we do provide a list of requirements.

You’ll notice in the main instructions it’s mostly just cloning repos and organizing folders.

Then it says:

After that your folder structure is complete and you’re ready to configure the individual components.

And then in the Trellis section

Trellis’ instructions apply here, but more specifically:
Make sure you have the requirements all installed

Those links go through the requirements like VirtualBox, Vagrant plugins, etc.

Maybe this could be more clear in a more explicit order though.