Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

...
  • 3 commits
  • 2 files changed
  • 0 commit comments
  • 2 contributors
Commits on Dec 23, 2011
Igal Koshevoy igal Fix issue #63: vagrant fails with mmap errors during apt-get.
The Vagrantfile described a cache to store downloaded packages on the
local machine and exported this to the guest, to save it from
re-downloading files if the guest was rest.

Unfortunately, `apt-get` only works if its files are on a local
filesystem or in NFS mounted directories, but not the default VirtualBox
file sharing. Therefore, this would fail for anyone not using NFS.

The solution is to only enable the package cache if the user has enabled
NFS file sharing mode.
590ca24
Commits on Mar 13, 2012
arnaud sellenet tabs cleaning adbb960
arnaud sellenet Merge remote-tracking branch 'upstream/master' e36b26e
Showing with 12 additions and 8 deletions.
  1. +9 −4 Vagrantfile
  2. +3 −4 lib/tasks/admin.rake
13 Vagrantfile
View
@@ -35,10 +35,15 @@ Vagrant::Config.run do |config|
# Share a folder with the guest VM for storing downloaded packages. This
# makes rebuilding VMs faster by only downloading packages if needed.
- require "fileutils"
- apt_cache = "tmp/vagrant_apt_cache"
- FileUtils.mkdir_p("#{apt_cache}/archives/partial")
- config.vm.share_folder "vagrant-apt-cache", "/var/cache/apt", apt_cache, :nfs => defined?(NFS) ? NFS : false
+ # NOTE: This is only enabled if using NFS because `apt-get` fails with
+ # "Couldn't make mmap" and "Unable to munmap" errors when using the default
+ # sharing mechanism.
+ if defined?(NFS) && NFS
+ require "fileutils"
+ apt_cache = "tmp/vagrant_apt_cache"
+ FileUtils.mkdir_p("#{apt_cache}/archives/partial")
+ config.vm.share_folder "vagrant-apt-cache", "/var/cache/apt", apt_cache, :nfs => true
+ end
# Use more memory so badly-designed programs like Bundler can work.
config.vm.customize do |vm|
7 lib/tasks/admin.rake
View
@@ -1,7 +1,7 @@
namespace :user do
namespace :admin do
desc 'Grants admin privileges to specified user email or login'
- task :grant, [:email] => :environment do |t,args|
+ task :grant, [:email] => :environment do |t,args|
find_user(args.email).grant!
end
desc 'Grants admin privileges to specified user email or login'
@@ -17,8 +17,7 @@ namespace :user do
def find_user(email)
puts email
user = User.find_by_email(email)
- puts('Not found') or exit(2) unless user
user
- end
+ end
end
-end
+end

No commit comments for this range

Something went wrong with that request. Please try again.