Ask A Question

Notifications

You’re not receiving notifications from this thread.

Using Vagrant for Rails Development Discussion

Chris Oliver asked in General
Ryan R Wilkins Ryan R Wilkins

Even after I assign 0.0.0.0 I am still unable to get my localhost to work on chrome.

"This site can’t be reached

localhost refused to connect.
"

Reply

Make sure you use

chef.channel = "stable"

So you don't accidentally get an unstable build that doesn't work with your vagrant setup.

Reply

Following these instructions I've been hit with this error:

[2016-06-22T22:33:38+00:00] INFO: HTTP Request Returned 404 Not Found: Parent not found: chefzero://localhost:8889/nodes

The server returned a HTTP 404. This usually indicates that your chef_server_url is incorrect.

chef_server_url "chefzero://localhost:8889"

I'm very new to all this and not sure what would need changed to fix it?!

Any help/hand holding would be great!

Reply

I struggled with this for a while, finding multiple stack overflow and github issues saying to specify a version of specify the channel to be stable. Finally figured out I had missed this step. Hope it helps someone
vagrant plugin install vagrant-librarian-chef-nochef

Reply

How to change the Vagrantfile to install Ruby 2.3.1, which is not downloadable as a binary?

Reply

Since we're using rbenv, it should compile Ruby instead of downloading it as a binary. You should be able to change the version numbers, although I haven't tried it with 2.3.1 yet.

Reply

It's been awhile since this guide was posted. In an effort to help those that come across it, here's a link to a more modern Vagrantfile based off of this guide. Hope it helps.

https://github.com/realchri...

Also, the official Vagrant image for xenial64 doesn't include a 'vagrant' user. See https://bugs.launchpad.net/... for more info. There's a workaround in the Vagrantfile I linked to that references this bug.

Reply

Thanks Chris! I'm going to try updating the tutorial this weekend using your notes. It's been a while since I've updated this. 🤘

Reply

Тупорылые авторы статей - после
vagrant up

- пишет:

ubuntu@127.0.0.1's password:

и всё блять, какой блять пасворд? долбаебы напишут а людям непонятно. вы хоть проверяли ваш код перед тем как людям предоставлять.

Reply

Nice job. But if I change anything in Vagrant file (i.e. add docker, change default ruby version) I get this notice on subsequent
`vagrant up` commands.
==> default: Installing Chef cookbooks with Librarian-Chef...
==> default: The cookbook path '/Users/lacoste/dev/testvagrant/site-cookbooks' doesn't exist. Ignoring...
Same when I try to run `vagrant provision`. So it looks likes whatever chef is doing only works on initial provision, or am I missing something? Thanks!

Reply

Add a site-cookbooks folder to your directory

Reply
Gerald Nah Gerald Nah

HI there, im having this problem after running vagrant up.

Followed all steps from copying both Vagrant and Cheffile into the same directory

C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.3/lib/vagrant/util/is_port_open.rb:21:in `initialize': The requested address is not valid in its context. - connect(2) for "0.0.0.0" port 3000 (Errno::EADDRNOTAVAIL)
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.3/lib/vagrant/util/is_port_open.rb:21:in `new'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.3/lib/vagrant/util/is_port_open.rb:21:in `block in is_port_open?'
from C:/HashiCorp/Vagrant/embedded/lib/ruby/2.2.0/timeout.rb:88:in `block in timeout'
from C:/HashiCorp/Vagrant/embedded/lib/ruby/2.2.0/timeout.rb:32:in `block in catch'
from C:/HashiCorp/Vagrant/embedded/lib/ruby/2.2.0/timeout.rb:32:in `catch'
from C:/HashiCorp/Vagrant/embedded/lib/ruby/2.2.0/timeout.rb:32:in `catch'
from C:/HashiCorp/Vagrant/embedded/lib/ruby/2.2.0/timeout.rb:103:in `timeout'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.3/lib/vagrant/util/is_port_open.rb:19:in `is_port_open?'

Reply

Hey I keep getting `NoMethodError: undefined method `include_default_source' for Custom resource ruby_rbenv_gem from cookbook ruby_rbenv`

Error executing action `install` on resource '[2.4.0::bundler (ubuntu)] (ubuntu)'

I don't use rbenv on my local machine. Does that matter for installing it on vb?

Reply
Ziyan Junaideen Ziyan Junaideen

For me it worked for 2.4.0 but not 2.2.7 which is a requirement for an old project of mine... any clue what caused it?

Reply

*** ALERT *** If you want a simple vagrant install that is Rails 5, ruby 2.4, and postgres. WITHOUT ansible or Cheffile. Listen here.
While this post was great at some point, it no longer is helpful without doing some troubleshooting. (This guide gave me outdated dependencies and errors that drove me nuts). Download the rails-dev-box and follow their simple instructions. The shell script file does everything without spitting 100's of lines of code. It just works.

Once again, not hating on this guide, I just found a much simpler one.

TLDR; https://github.com/rails/ra...

Reply

After I fire the command `vagrant provision`
I get this error

==> default: executable=/opt/chef/bin/chef-solo
==> default: Running handlers:
==> default: [2017-07-17T12:19:39+00:00] ERROR: Running exception handlers
==> default: Running handlers complete

==> default: [2017-07-17T12:19:39+00:00] ERROR: Exception handlers complete
==> default: Chef Client failed. 0 resources updated in 01 seconds
==> default: [2017-07-17T12:19:39+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
==> default: [2017-07-17T12:19:39+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
==> default: [2017-07-17T12:19:39+00:00] ERROR: 412 "Precondition Failed"
==> default: [2017-07-17T12:19:39+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
Chef never successfully completed! Any errors should be visible in the

I m new to this vagrant, i googled it but was not able to get the right answer to this problem
pls help

Reply
Peter Blackledge Peter Blackledge

On Windows 10 I'm trying to install Rails on Vagrant on drive D:. After creating the Cheffile and Vagrantfile as directed, the 'vagrant up' command fails with error message: 'D:/vboxes/gems/2.3.4/gems/librarian-chef-nochef-0.2.0/lib/librarian/chef/source/site.rb:309:in `unpack_package!': The package archive has too many children! (RuntimeError)' followed by dozens more file and command errors.
There are a few online discussions - going back several years - about this 'too many children' Chef error. Some possible solutions are proposed, most beyond my technical know-how, and no definite resolution that I can see.
Can anyone point to a reliable answer?

Reply

same issue

Reply

I'm working through this now. https://github.com/applicat... Looks like this issue was closed long ago but has reemerged. Will try to come back with a fix if I figure it out... which I will probably forget to do once I have figured it out :P

Reply
I too have battled with this for ages, using vagrant et al on Ubuntu 17.10. Kept getting the "too many children" error. I discovered that many thought the problem was with "archive-tar-minitar" gem, which used to be true but has been fixed by giving Vagrant a new dependency on "minitar" instead - see here.  So that line of research proved fruitless, however, inspired by Chris' debugging adventures, I dug deeper. The error message located the problem at ~/.vagrant.d/gems/2.3.3/gems/librarian-chef-nochef-0.2.0/lib/librarian/chef/source/site.rb:309. So I had a look and found the following:
303             # Cookbook files, as pulled from Opscode Community Site API, are
304             # embedded in a subdirectory of the tarball. If created by git archive they
305             # can include the subfolder `pax_global_header`, which is ignored.
306             subtemps = temp.children
307             subtemps.empty? and raise "The package archive was empty!"
308             subtemps.delete_if{|pth| pth.to_s[/pax_global_header/]}
309             subtemps.size > 1 and raise "The package archive has too many children!"

I tracked down the first package to fail (system) and examined the value of subtemps to find that there was a second child subdirectory, but its name did not match the 'pax_global_header' string. It was 'PaxHeader'.
I added in a line to delete that..
308             subtemps.delete_if{|pth| pth.to_s[/pax_global_header/]}
309(new)        subtemps.delete_if{|pth| pth.to_s[/PaxHeader/]}
... and Hey Presto! the 'vagrant up' command now completes and we are up and running.

Ah! WAIT... that's not quite true. So much junk lying around from previous attempts that it masked the error in my thinking. PaxHeader may seem to be something useful, so a re-think is required. I'll update you all when I unravel it :)
Reply

Hi There, i get the following error can you please help
/Users/khashayaryousefi/.vagrant.d/gems/2.3.4/gems/librarian-chef-nochef-0.2.0/lib/librarian/chef/source/site.rb:309:in `unpack_package!': The package archive has too many children! (RuntimeError)

Reply

unsubscripe

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 82,329+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more.

    © 2024 GoRails, LLC. All rights reserved.