DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
Building Scalable Real-Time Apps with AstraDB and Vaadin
Register Now

Trending

  • What Is React? A Complete Guide
  • What Is mTLS? How To Implement It With Istio
  • Essential Architecture Framework: In the World of Overengineering, Being Essential Is the Answer
  • Design Patterns for Microservices: Ambassador, Anti-Corruption Layer, and Backends for Frontends

Trending

  • What Is React? A Complete Guide
  • What Is mTLS? How To Implement It With Istio
  • Essential Architecture Framework: In the World of Overengineering, Being Essential Is the Answer
  • Design Patterns for Microservices: Ambassador, Anti-Corruption Layer, and Backends for Frontends
  1. DZone
  2. Data Engineering
  3. Data
  4. Vagrant 1.2.2: Can’t Convert Symbol into Integer (TypeError)

Vagrant 1.2.2: Can’t Convert Symbol into Integer (TypeError)

Mark Needham user avatar by
Mark Needham
·
Jul. 02, 13 · Interview
Like (0)
Save
Tweet
Share
6.96K Views

Join the DZone community and get the full member experience.

Join For Free

As I mentioned in my previous post I’ve been playing around with Vagrant for the past couple of days and I was trying to adapt a Vagrantfile that Nathan created a few months ago to do what I wanted.

I’m using Vagrant 1.2.2 and I started out with the following Vagrantfile:

Vagrant.configure("2") do |config|   
  config.vm.box = "precise64"
  config.vm.box_url = "http://files.vagrantup.com/precise64.box"
 
  config.vm.define :neo01 do |neo|    
    neo.vm.network :hostonly, "192.168.33.101"
    neo.vm.forward_port 8080, 4569
  end
end

Unfortunately a ‘vagrant up’ doesn’t quite work as expected:

$ vagrant up
/Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/plugins/kernel_v2/config/vm.rb:146:in `[]': can't convert Symbol into Integer (TypeError)
	from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/plugins/kernel_v2/config/vm.rb:146:in `network'
	from /Users/markneedham/projects/support/haproxy/Vagrantfile:19:in `block (2 levels) in <top (required)>'
	from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/config/v2/loader.rb:37:in `call'
	from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/config/v2/loader.rb:37:in `load'
	from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/config/loader.rb:104:in `block (2 levels) in load'
	from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/config/loader.rb:98:in `each'
	from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/config/loader.rb:98:in `block in load'
	from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/config/loader.rb:95:in `each'
	from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/config/loader.rb:95:in `load'
	from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/environment.rb:329:in `machine'
	from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/plugin/v2/command.rb:131:in `block in with_target_vms'
	from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/plugin/v2/command.rb:164:in `call'
	from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/plugin/v2/command.rb:164:in `block in with_target_vms'
	from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/plugin/v2/command.rb:163:in `map'
	from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/plugin/v2/command.rb:163:in `with_target_vms'
	from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/plugins/commands/up/command.rb:42:in `block in execute'
	from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/environment.rb:206:in `block (2 levels) in batch'
	from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/environment.rb:204:in `tap'
	from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/environment.rb:204:in `block in batch'
	from <internal:prelude>:10:in `synchronize'
	from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/environment.rb:203:in `batch'
	from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/plugins/commands/up/command.rb:41:in `execute'
	from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/cli.rb:46:in `execute'
	from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/environment.rb:467:in `cli'
	from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/bin/vagrant:84:in `<top (required)>'
	from /Applications/Vagrant/bin/../embedded/gems/bin/vagrant:23:in `load'
	from /Applications/Vagrant/bin/../embedded/gems/bin/vagrant:23:in `<main>'

The problem line is ‘neo.vm.network :hostonly, “192.168.33.101″‘ which I learnt is because the way you setup networking has changed slightly between the versions.

We now need something like this:

Vagrant.configure("2") do |config|   
  config.vm.box = "precise64"
  config.vm.box_url = "http://files.vagrantup.com/precise64.box"
 
  config.vm.define :neo01 do |neo|    
    neo.vm.network :private_network, ip: "192.168.33.101"
    neo.vm.forward_port 8080, 4569
  end
end

If we run ‘vagrant up’ again we’ll see that error has been removed and we have a new one!

$ vagrant up
Bringing machine 'neo01' up with 'virtualbox' provider...
There are errors in the configuration of this machine. Please fix
the following errors and try again:
 
vm:
* The following settings don't exist: forward_port

It turns out the way that we do port forwarding has also changed. Annoyingly if you google ‘vagrant port forwarding’ it still points you to the old documentation rather than the newer one.

We need to change our code to the following:

Vagrant.configure("2") do |config|   
  config.vm.box = "precise64"
  config.vm.box_url = "http://files.vagrantup.com/precise64.box"
 
  config.vm.define :neo01 do |neo|    
    neo.vm.network :private_network, ip: "192.168.33.101"
    neo.vm.network :forwarded_port, host: 4569, guest: 8080
  end
end

If we run ‘vagrant up’ now it’s much happier:

$ vagrant up
Bringing machine 'neo01' up with 'virtualbox' provider...
[neo01] Setting the name of the VM...
[neo01] Clearing any previously set forwarded ports...
...
Convert (command) Data Types

Published at DZone with permission of Mark Needham, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Trending

  • What Is React? A Complete Guide
  • What Is mTLS? How To Implement It With Istio
  • Essential Architecture Framework: In the World of Overengineering, Being Essential Is the Answer
  • Design Patterns for Microservices: Ambassador, Anti-Corruption Layer, and Backends for Frontends

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com

Let's be friends: