my vagrantfile work perfectly but when i uncomment synce folder and set it to real path and make vagrant reload it return a exception:
/Users/pedrammarandi/pedram/Vagrantfile:41:in `block in <top (required)>': undefined local variable or method `“' for main:Object (NameError)
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/config/v2/loader.rb:37:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/config/v2/loader.rb:37:in `load'
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/config/loader.rb:103:in `block (2 levels) in load'
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/config/loader.rb:97:in `each'
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/config/loader.rb:97:in `block in load'
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/config/loader.rb:94:in `each'
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/config/loader.rb:94:in `load'
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/vagrantfile.rb:28:in `initialize'
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/environment.rb:689:in `new'
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/environment.rb:689:in `vagrantfile'
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/environment.rb:441:in `host'
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/environment.rb:207:in `block in action_runner'
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/runner.rb:33:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/runner.rb:33:in `run'
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/environment.rb:428:in `hook'
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/environment.rb:671:in `unload'
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/bin/vagrant:177:in `ensure in <main>'
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/bin/vagrant:177:in `<main>'
line 41:
config.vm.synced_folder “/”, “/var/www/pedram.dev”
you have something wrong with the funky character `“' and vagrant is telling your about it
undefined local variable or method `“'
maybe some copy/paste from ms word or something just put simple "
config.vm.synced_folder "/", "/var/www/pedram.dev"
it will run smoothly
Related
I added a new folder ./data inside boxes\ubuntu-xenial64\ and edited the Vagrantfile by uncommenting this line:
config.vm.synced_folder "./data", "/vagrant_data"
Getting error as below:
PS C:\Users\sridh\.vagrant.d\boxes\ubuntu-VAGRANTSLASH-xenial64> vagrant up
C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.3.0/rubygems/version.rb:207:in `initialize': Malformed version number string data (ArgumentError)
from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.3.0/rubygems/version.rb:199:in `new'
from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.3.0/rubygems/version.rb:199:in `new'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/box_collection.rb:289:in `block (2 levels) in find'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/box_collection.rb:285:in `map'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/box_collection.rb:285:in `block in find'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/box_collection.rb:448:in `block in with_collection_lock'
from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/box_collection.rb:447:in `with_collection_lock'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/box_collection.rb:271:in `find'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/vagrantfile.rb:167:in `block in machine_config'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/vagrantfile.rb:200:in `machine_config'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/vagrantfile.rb:45:in `machine'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/environment.rb:733:in `machine'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/plugin/v2/command.rb:177:in `block in with_target_vms'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/plugin/v2/command.rb:201:in `block in with_target_vms'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/plugin/v2/command.rb:183:in `each'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/plugin/v2/command.rb:183:in `with_target_vms'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/commands/up/command.rb:87:in `execute'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/cli.rb:42:in `execute'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/environment.rb:308:in `cli'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.8/bin/vagrant:138:in `<main>'
/Users/shaddeler/Developer/run/Homestead/scripts/homestead.rb:169:in `+': no implicit conversion of nil into String (TypeError)
from /Users/shaddeler/Developer/run/Homestead/scripts/homestead.rb:169:in `block (2 levels) in configure'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/plugins/kernel_v2/config/vm_provisioner.rb:72:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/plugins/kernel_v2/config/vm_provisioner.rb:72:in `add_config'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/plugins/kernel_v2/config/vm.rb:324:in `provision'
from /Users/shaddeler/Developer/run/Homestead/scripts/homestead.rb:168:in `block in configure'
from /Users/shaddeler/Developer/run/Homestead/scripts/homestead.rb:157:in `each'
from /Users/shaddeler/Developer/run/Homestead/scripts/homestead.rb:157:in `configure'
from /Users/shaddeler/Developer/run/Homestead/Vagrantfile:30:in `block in <top (required)>'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/config/v2/loader.rb:37:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/config/v2/loader.rb:37:in `load'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/config/loader.rb:113:in `block (2 levels) in load'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/config/loader.rb:107:in `each'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/config/loader.rb:107:in `block in load'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/config/loader.rb:104:in `each'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/config/loader.rb:104:in `load'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/vagrantfile.rb:28:in `initialize'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/environment.rb:746:in `new'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/environment.rb:746:in `vagrantfile'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/environment.rb:492:in `host'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/environment.rb:214:in `block in action_runner'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/action/runner.rb:33:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/action/runner.rb:33:in `run'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/environment.rb:479:in `hook'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/environment.rb:728:in `unload'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/bin/vagrant:177:in `ensure in <main>'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/bin/vagrant:177:in `<main>'
I enfaced this error while vagrant up
I had this problem too. Instead of a wrong indentation, I accidentally added another dash ( - ) to my Homestead.yaml file.
For example, this is the incorrect one:
- map: testing.khc.my
- to: /home/vagrant/code/testing/public
The correct one is this:
- map: testing.khc.my
to: /home/vagrant/code/testing/public
Hope this help everyone in the future.
I got this error too and it's a real pain. The source of the problem is a wrong indentation in the Homestead.yaml file. Check if you're using spaces or tabs.
I am trying to get Vagrant to work. I installed everything but when I run "vagrant up" in the terminal, I get the following error
$ vagrant up
/Users/charleswang1104/.vagrant.d/gems/gems/docker-provider-0.1.0/lib/docker-provider/errors.rb:6:in `<module:Errors>': superclass mismatch for class ImageNotConfiguredError (TypeError)
from /Users/charleswang1104/.vagrant.d/gems/gems/docker-provider-0.1.0/lib/docker-provider/errors.rb:5:in `<module:DockerProvider>'
from /Users/charleswang1104/.vagrant.d/gems/gems/docker-provider-0.1.0/lib/docker-provider/errors.rb:4:in `<module:VagrantPlugins>'
from /Users/charleswang1104/.vagrant.d/gems/gems/docker-provider-0.1.0/lib/docker-provider/errors.rb:3:in `<top (required)>'
from /Users/charleswang1104/.vagrant.d/gems/gems/docker-provider-0.1.0/lib/docker-provider/action/prepare_nfs_settings.rb:1:in `require_relative'
from /Users/charleswang1104/.vagrant.d/gems/gems/docker-provider-0.1.0/lib/docker-provider/action/prepare_nfs_settings.rb:1:in `<top (required)>'
from /Users/charleswang1104/.vagrant.d/gems/gems/docker-provider-0.1.0/lib/docker-provider/action.rb:9:in `require_relative'
from /Users/charleswang1104/.vagrant.d/gems/gems/docker-provider-0.1.0/lib/docker-provider/action.rb:9:in `<top (required)>'
from /Users/charleswang1104/.vagrant.d/gems/gems/docker-provider-0.1.0/lib/docker-provider/provider.rb:2:in `require_relative'
from /Users/charleswang1104/.vagrant.d/gems/gems/docker-provider-0.1.0/lib/docker-provider/provider.rb:2:in `<top (required)>'
from /Users/charleswang1104/.vagrant.d/gems/gems/docker-provider-0.1.0/lib/docker-provider/plugin.rb:16:in `require_relative'
from /Users/charleswang1104/.vagrant.d/gems/gems/docker-provider-0.1.0/lib/docker-provider/plugin.rb:16:in `block in <class:Plugin>'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.1/lib/vagrant/plugin/v2/plugin.rb:193:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.1/lib/vagrant/plugin/v2/plugin.rb:193:in `block in provider'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.1/lib/vagrant/registry.rb:27:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.1/lib/vagrant/registry.rb:27:in `get'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.1/lib/vagrant/registry.rb:48:in `block in each'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.1/lib/vagrant/registry.rb:47:in `each'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.1/lib/vagrant/registry.rb:47:in `each'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.1/lib/vagrant/environment.rb:272:in `default_provider'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.1/lib/vagrant/plugin/v2/command.rb:165:in `block in with_target_vms'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.1/lib/vagrant/plugin/v2/command.rb:192:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.1/lib/vagrant/plugin/v2/command.rb:192:in `block in with_target_vms'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.1/lib/vagrant/plugin/v2/command.rb:174:in `each'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.1/lib/vagrant/plugin/v2/command.rb:174:in `with_target_vms'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.1/plugins/commands/up/command.rb:67:in `block in execute'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.1/lib/vagrant/environment.rb:238:in `block (2 levels) in batch'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.1/lib/vagrant/environment.rb:236:in `tap'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.1/lib/vagrant/environment.rb:236:in `block in batch'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.1/lib/vagrant/environment.rb:235:in `synchronize'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.1/lib/vagrant/environment.rb:235:in `batch'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.1/plugins/commands/up/command.rb:58:in `execute'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.1/lib/vagrant/cli.rb:42:in `execute'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.1/lib/vagrant/environment.rb:252:in `cli'
from /Applications/Vagrant/bin/../embedded/gems/gems/vagrant-1.6.1/bin/vagrant:166:in `<main>'
Please let me know how I can fix this problem. Thanks!
Just run the following command:
vagrant plugin uninstall docker-provider
Guys I have no clue in ruby but forced to play around with a chef recipe. Can someone help me with a syntax issue ?
These line is causing problems when I run the recipe
old_configs = node["monitoring"]["configs"] || []
And the exception is :
NoMethodError: undefined method `[]' for nil:NilClass /var/chef/cache/cookbooks/collectd/recipes/default.rb:100:in `from_file'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.0/lib/chef/mixin/from_file.rb:30:in `instance_eval'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.0/lib/chef/mixin/from_file.rb:30:in `from_file'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.0/lib/chef/cookbook_version.rb:237:in `load_recipe'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.0/lib/chef/run_context.rb:151:in `load_recipe'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.0/lib/chef/run_context/cookbook_compiler.rb:139:in `block in compile_recipe
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.0/lib/chef/run_context/cookbook_compiler.rb:137:in `each'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.0/lib/chef/run_context/cookbook_compiler.rb:137:in `compile_recipes'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.0/lib/chef/run_context/cookbook_compiler.rb:74:in `compile'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.0/lib/chef/run_context.rb:86:in `load'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.0/lib/chef/client.rb:249:in `setup_run_context'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.0/lib/chef/client.rb:492:in `do_run'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.0/lib/chef/client.rb:199:in `block in run'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.0/lib/chef/client.rb:193:in `fork'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.0/lib/chef/client.rb:193:in `run'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.0/lib/chef/application.rb:183:in `run_chef_client'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.0/lib/chef/application/client.rb:302:in `block in run_application'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.0/lib/chef/application/client.rb:294:in `loop'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.0/lib/chef/application/client.rb:294:in `run_application'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.0/lib/chef/application.rb:66:in `run'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.0/bin/chef-client:26:in `<top (required)>'
This is probably caused by the fact that the node "monitoring" attribute does not exist, you should first check that node["monitoring"] exists, before trying to lookup node["monitoring"]["configs"]
The simple way to do it would be:
if node["monitoring"]
old_configs = node["monitoring"]["configs"] || []
end
I'm getting a strange error when running cap deploy:setup:
cap deploy:setup
Using ActiveModel validations.
Validations included SimpleRecord::Base
New Aws::SdbInterface using per_thread-connection mode
New Aws::S3Interface using per_thread-connection mode
/Users/myusername/.rvm/gems/ruby-1.9.2-p136#sinatra/gems/capistrano-2.5.21/lib/capistrano/command.rb:24:in `initialize': undefined method `strip' for Sinatra::Application:Class (NoMethodError)
from /Users/myusername/.rvm/gems/ruby-1.9.2-p136#sinatra/gems/capistrano-2.5.21/lib/capistrano/command.rb:109:in `new'
from /Users/myusername/.rvm/gems/ruby-1.9.2-p136#sinatra/gems/capistrano-2.5.21/lib/capistrano/command.rb:109:in `else'
from /Users/myusername/.rvm/gems/ruby-1.9.2-p136#sinatra/gems/capistrano-2.5.21/lib/capistrano/configuration/actions/invocation.rb:144:in `block in run'
from /Users/myusername/.rvm/gems/ruby-1.9.2-p136#sinatra/gems/capistrano-2.5.21/lib/capistrano/command.rb:101:in `initialize'
from /Users/myusername/.rvm/gems/ruby-1.9.2-p136#sinatra/gems/capistrano-2.5.21/lib/capistrano/configuration/actions/invocation.rb:144:in `new'
from /Users/myusername/.rvm/gems/ruby-1.9.2-p136#sinatra/gems/capistrano-2.5.21/lib/capistrano/configuration/actions/invocation.rb:144:in `run'
from Capfile:9:in `load'
from /Users/myusername/.rvm/gems/ruby-1.9.2-p136#sinatra/gems/capistrano-2.5.21/lib/capistrano/configuration/loading.rb:93:in `instance_eval'
from /Users/myusername/.rvm/gems/ruby-1.9.2-p136#sinatra/gems/capistrano-2.5.21/lib/capistrano/configuration/loading.rb:93:in `load'
from /Users/myusername/.rvm/gems/ruby-1.9.2-p136#sinatra/gems/capistrano-2.5.21/lib/capistrano/configuration/loading.rb:172:in `load_from_file'
from /Users/myusername/.rvm/gems/ruby-1.9.2-p136#sinatra/gems/capistrano-2.5.21/lib/capistrano/configuration/loading.rb:89:in `load'
from /Users/myusername/.rvm/gems/ruby-1.9.2-p136#sinatra/gems/capistrano-2.5.21/lib/capistrano/configuration/loading.rb:86:in `block in load'
from /Users/myusername/.rvm/gems/ruby-1.9.2-p136#sinatra/gems/capistrano-2.5.21/lib/capistrano/configuration/loading.rb:86:in `each'
from /Users/myusername/.rvm/gems/ruby-1.9.2-p136#sinatra/gems/capistrano-2.5.21/lib/capistrano/configuration/loading.rb:86:in `load'
from /Users/myusername/.rvm/gems/ruby-1.9.2-p136#sinatra/gems/capistrano-2.5.21/lib/capistrano/cli/execute.rb:65:in `block in load_recipes'
from /Users/myusername/.rvm/gems/ruby-1.9.2-p136#sinatra/gems/capistrano-2.5.21/lib/capistrano/cli/execute.rb:65:in `each'
from /Users/myusername/.rvm/gems/ruby-1.9.2-p136#sinatra/gems/capistrano-2.5.21/lib/capistrano/cli/execute.rb:65:in `load_recipes'
from /Users/myusername/.rvm/gems/ruby-1.9.2-p136#sinatra/gems/capistrano-2.5.21/lib/capistrano/cli/execute.rb:31:in `execute!'
from /Users/myusername/.rvm/gems/ruby-1.9.2-p136#sinatra/gems/capistrano-2.5.21/lib/capistrano/cli/execute.rb:14:in `execute'
from /Users/myusername/.rvm/gems/ruby-1.9.2-p136#sinatra/gems/capistrano-2.5.21/bin/cap:4:in `<top (required)>'
from /Users/myusername/.rvm/gems/ruby-1.9.2-p136#sinatra/bin/cap:19:in `load'
from /Users/myusername/.rvm/gems/ruby-1.9.2-p136#sinatra/bin/cap:19:in `<main>'
Any ideas on how to troubleshoot this?
It turns out the MyApp.rb did not actually define class MyApp. I added this:
class MyApp < Sinatra::Base
that error is now cleared.