rails / rails-dev-box

A virtual machine for Ruby on Rails core development
MIT License
2.05k stars 580 forks source link

Installing nokogiri 1.6.7.1 with native extensions Killed #116

Closed shingo-nakanishi closed 8 years ago

shingo-nakanishi commented 8 years ago

bundle

vagrant@rails-dev-box:~$ cd /vagrant/rails/
vagrant@rails-dev-box:/vagrant/rails$ bundle

rails/rails at 4-2-stable: Ruby on Rails (commit number: e531c86e6bb0b623cd18c97a7a32ba981e8fb2ce)

Killed

Installing nokogiri 1.6.7.1 with native extensions
Killed

sudo gem install nokogiri -v '1.6.7.1'

vagrant@rails-dev-box:/vagrant/rails$ gem install nokogiri -v '1.6.7.1'
Fetching: nokogiri-1.6.7.1.gem (100%)
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /var/lib/gems/2.3.0 directory.
vagrant@rails-dev-box:/vagrant/rails$ sudo gem install nokogiri -v '1.6.7.1'
Building native extensions.  This could take a while...
Successfully installed nokogiri-1.6.7.1
Parsing documentation for nokogiri-1.6.7.1
Installing ri documentation for nokogiri-1.6.7.1
Done installing documentation for nokogiri after 3 seconds
1 gem installed

Re bundle is ok

re run bundle is ok.

Is this correct way?

Is this correct way?

yahonda commented 8 years ago

I also got this error and found a way to address this.

> vagrant ssh
$ sudo apt-get update
$ sudo apt-get dist-upgrade
$ sudo reboot

then execute bundle which installs nokogiri without installing this gem separately. You can find all the output here .

I do not think this is rails-dev-box issue, rather than nokogiri installation on Ubuntu 14.04.4 LTS, and it has been already addressed by upgrading ubuntu packages.

fxn commented 8 years ago

Could you try adding RAM to the VM?

config.vm.provider "virtualbox" do |v|
  v.memory = 1024
end
shingo-nakanishi commented 8 years ago

apt-get way

after vagrant destroy

I try sudo apt-get update, sudo apt-get dist-upgrade, sudo reboot

after sudo reboot, no exist mount for rails.

Log

vagrant@rails-dev-box:/vagrant/rails$ sudo reboot
vagrant@rails-dev-box:/vagrant/rails$ 
Broadcast message from vagrant@rails-dev-box
    (/dev/pts/0) at 0:39 ...

The system is going down for reboot NOW!
Connection to 127.0.0.1 closed by remote host.
Connection to 127.0.0.1 closed.
~/Documents/workout/rails-dev-box(master|✔) % vagrant ssh
Welcome to Ubuntu 14.04.4 LTS (GNU/Linux 3.13.0-79-generic x86_64)

 * Documentation:  https://help.ubuntu.com/

  System information as of Fri Feb 26 00:39:45 UTC 2016

  System load: 0.0               Memory usage: 9%   Processes:       50
  Usage of /:  5.2% of 39.34GB   Swap usage:   0%   Users logged in: 0

  Graph this data and manage this system at:
    https://landscape.canonical.com/

  Get cloud support with Ubuntu Advantage Cloud Guest:
    http://www.ubuntu.com/business/services/cloud

Last login: Fri Feb 26 00:33:47 2016 from 10.0.2.2
vagrant@rails-dev-box:~$ ll
total 36
drwxr-xr-x 5 vagrant vagrant 4096 Feb 26 00:39 ./
drwxr-xr-x 4 root    root    4096 Feb 26 00:28 ../
-rw------- 1 vagrant vagrant   84 Feb 26 00:39 .bash_history
-rw-r--r-- 1 vagrant vagrant  220 Apr  9  2014 .bash_logout
-rw-r--r-- 1 vagrant vagrant 3637 Apr  9  2014 .bashrc
drwxrwxr-x 4 vagrant vagrant 4096 Feb 26 00:34 .bundler/
drwx------ 2 vagrant vagrant 4096 Feb 26 00:28 .cache/
-rw-r--r-- 1 vagrant vagrant  675 Apr  9  2014 .profile
drwx------ 2 vagrant vagrant 4096 Feb 26 00:28 .ssh/
vagrant@rails-dev-box:~$ cd /va
vagrant/ var/     
vagrant@rails-dev-box:~$ cd /va
vagrant/ var/     
vagrant@rails-dev-box:~$ cd /vagrant/
vagrant@rails-dev-box:/vagrant$ ls     # NO EXIST MOUNT FOR rails
vagrant@rails-dev-box:/vagrant$ exit

v.memory = 1024 way

after vagrant destroy

Log

bundle is ok.

~/Documents/workout/rails-dev-box(master|✚1) % cat Vagrantfile 
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure('2') do |config|
  config.vm.box      = 'ubuntu/trusty64'
  config.vm.hostname = 'rails-dev-box'

  config.vm.provider "virtualbox" do |v|
    v.memory = 1024
  end

  config.vm.network :forwarded_port, guest: 3000, host: 3000

  config.vm.provision :shell, path: 'bootstrap.sh', keep_color: true
end

~/Documents/workout/rails-dev-box(master|✚1) % vagrant up 
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'ubuntu/trusty64'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'ubuntu/trusty64' is up to date...
==> default: A newer version of the box 'ubuntu/trusty64' is available! You currently
==> default: have version '20160215.0.0'. The latest is version '20160222.0.0'. Run
==> default: `vagrant box update` to update.
==> default: Setting the name of the VM: rails-dev-box_default_1456444355020_9773
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 3000 (guest) => 3000 (host) (adapter 1)
    default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: 
    default: Vagrant insecure key detected. Vagrant will automatically replace
    default: this with a newly generated keypair for better security.
    default: 
    default: Inserting generated public key within guest...
    default: Removing insecure key from the guest if it's present...
    default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
    default: The guest additions on this VM do not match the installed version of
    default: VirtualBox! In most cases this is fine, but in rare cases it can
    default: prevent things such as shared folders from working properly. If you see
    default: shared folder errors, please make sure the guest additions within the
    default: virtual machine match the version of VirtualBox you have installed on
    default: your host and reload your VM.
    default: 
    default: Guest Additions Version: 4.3.36
    default: VirtualBox Version: 5.0
==> default: [vagrant-hostsupdater] Checking for host entries
==> default: Setting hostname...
==> default: Mounting shared folders...
    default: /vagrant => /Users/shingo/Documents/workout/rails-dev-box
==> default: Running provisioner: shell...
    default: Running: /var/folders/l7/z88zzs352xsf1vg9qtznkr6h0000gn/T/vagrant-shell20160226-1028-o0xu4q.sh
==> default: stdin: is not a tty
==> default: updating package information
==> default: installing development tools
==> default: installing Ruby
==> default: installing Bundler
==> default: installing Git
==> default: installing SQLite
==> default: installing memcached
==> default: installing Redis
==> default: installing RabbitMQ
==> default: installing PostgreSQL
==> default: installing MySQL
==> default: installing Nokogiri dependencies
==> default: installing ExecJS runtime
==> default: all set, rock on!
~/Documents/workout/rails-dev-box(master|✚1) % vagrant ssh
Welcome to Ubuntu 14.04.3 LTS (GNU/Linux 3.13.0-77-generic x86_64)

 * Documentation:  https://help.ubuntu.com/

  System information as of Thu Feb 25 23:52:55 UTC 2016

  System load:  0.7               Processes:           81
  Usage of /:   3.5% of 39.34GB   Users logged in:     0
  Memory usage: 12%               IP address for eth0: 10.0.2.15
  Swap usage:   0%

  Graph this data and manage this system at:
    https://landscape.canonical.com/

  Get cloud support with Ubuntu Advantage Cloud Guest:
    http://www.ubuntu.com/business/services/cloud

0 packages can be updated.
0 updates are security updates.

vagrant@rails-dev-box:~$ cd /vagrant/rails/
vagrant@rails-dev-box:/vagrant/rails$ bundle
Fetching git://github.com/bkeepers/qu.git
warning: cannot parse SRV response: Message too long
Fetching gem metadata from https://rubygems.org/..........
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies....
Installing rake 10.4.2
Installing i18n 0.7.0
Using json 1.8.3
Installing minitest 5.3.3
Installing thread_safe 0.3.5
Installing builder 3.2.2
Installing erubis 2.7.0
Installing mini_portile2 2.0.0
Installing rack 1.6.4
Installing mime-types 2.99
Installing arel 6.0.3
Installing amq-protocol 1.9.2
Installing beaneater 1.0.0
Installing dante 0.2.0
Installing bcrypt 3.1.10 with native extensions
Installing benchmark-ips 2.3.0
Using bundler 1.11.2
Installing timers 1.1.0
Installing coffee-script-source 1.10.0
Installing execjs 2.4.0
Installing thor 0.19.1
Installing concurrent-ruby 1.0.0
Installing connection_pool 2.2.0
Installing dalli 2.7.5
Installing mustache 0.99.8
Installing metaclass 0.0.4
Installing mono_logger 1.1.0
Installing multi_json 1.11.2
Installing mysql 2.9.1 with native extensions
Installing mysql2 0.4.2 with native extensions
Installing pg 0.18.4 with native extensions
Using qu 0.2.0 from git://github.com/bkeepers/qu.git (at master@d098e26)
Installing redis 3.2.2
Installing que 0.11.2
Installing racc 1.4.14 with native extensions
Using rdoc 4.2.1
Installing redcarpet 3.1.2 with native extensions
Installing tilt 2.0.1
Installing rufus-scheduler 3.1.10
Installing sequel 4.29.0
Installing sigdump 0.2.3
Installing thread 0.2.2
Installing sqlite3 1.3.11 with native extensions
Installing stackprof 0.2.7 with native extensions
Installing tzinfo 1.2.2
Installing nokogiri 1.6.7.1 with native extensions
Installing rack-test 0.6.3
Installing rack-cache 1.5.1
Installing rack-protection 1.5.3
Installing sprockets 3.0.3
Installing vegas 0.1.11
Installing mail 2.6.3
Installing bunny 1.1.9
Installing backburner 1.2.0
Installing celluloid 0.15.2
Installing coffee-script 2.4.1
Installing uglifier 2.7.2
Installing mocha 0.14.0
Installing queue_classic 3.1.0
Installing redis-namespace 1.5.2
Installing sidekiq 4.0.1
Installing sdoc 0.4.1
Installing serverengine 1.5.11
Using activesupport 4.2.5.1 from source at `.`
Installing loofah 2.0.3
Installing kindlerb 0.1.1
Installing w3c_validators 1.2
Installing sinatra 1.4.6
Installing sucker_punch 1.0.5
Using qu-redis 0.2.0 from git://github.com/bkeepers/qu.git (at master@d098e26)
Installing sneakers 0.1.1.pre
Installing rails-deprecated_sanitizer 1.0.3
Installing globalid 0.3.6
Using activemodel 4.2.5.1 from source at `.`
Installing delayed_job 4.1.1
Installing rails-html-sanitizer 1.0.3
Installing resque 1.25.2
Installing rails-dom-testing 1.0.7
Using activejob 4.2.5.1 from source at `.`
Using activerecord 4.2.5.1 from source at `.`
Installing resque-scheduler 4.0.0
Using actionview 4.2.5.1 from source at `.`
Installing delayed_job_active_record 4.1.0
Using actionpack 4.2.5.1 from source at `.`
Using actionmailer 4.2.5.1 from source at `.`
Using railties 4.2.5.1 from source at `.`
Installing sprockets-rails 3.0.0
Installing coffee-rails 4.1.1
Installing jquery-rails 4.0.5
Using qu-rails 0.2.0 from git://github.com/bkeepers/qu.git (at master@d098e26)
Using rails 4.2.5.1 from source at `.`
Installing turbolinks 2.5.3
Bundle complete! 46 Gemfile dependencies, 92 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.

TEST

Why Skip and Failure test?(But this Issue for nokogiri)

vagrant@rails-dev-box:/vagrant/rails$ cd actionview/
vagrant@rails-dev-box:/vagrant/rails/actionview$ bundle exec rake test
/usr/bin/ruby2.3 -w -I"lib:test" -I"/var/lib/gems/2.3.0/gems/rake-10.4.2/lib" "/var/lib/gems/2.3.0/gems/rake-10.4.2/lib/rake/rake_test_loader.rb" "test/template/active_model_helper_test.rb" "test/template/asset_tag_helper_test.rb" "test/template/atom_feed_helper_test.rb" "test/template/capture_helper_test.rb" "test/template/compiled_templates_test.rb" "test/template/date_helper_i18n_test.rb" "test/template/date_helper_test.rb" "test/template/dependency_tracker_test.rb" "test/template/digestor_test.rb" "test/template/erb/form_for_test.rb" "test/template/erb/tag_helper_test.rb" "test/template/erb_util_test.rb" "test/template/form_collections_helper_test.rb" "test/template/form_helper_test.rb" "test/template/form_options_helper_i18n_test.rb" "test/template/form_options_helper_test.rb" "test/template/form_tag_helper_test.rb" "test/template/html_test.rb" "test/template/javascript_helper_test.rb" "test/template/log_subscriber_test.rb" "test/template/lookup_context_test.rb" "test/template/number_helper_test.rb" "test/template/output_safety_helper_test.rb" "test/template/partial_iteration_test.rb" "test/template/record_identifier_test.rb" "test/template/record_tag_helper_test.rb" "test/template/render_test.rb" "test/template/resolver_patterns_test.rb" "test/template/sanitize_helper_test.rb" "test/template/streaming_render_test.rb" "test/template/tag_helper_test.rb" "test/template/template_error_test.rb" "test/template/template_test.rb" "test/template/test_case_test.rb" "test/template/test_test.rb" "test/template/testing/fixture_resolver_test.rb" "test/template/testing/null_resolver_test.rb" "test/template/text_helper_test.rb" "test/template/text_test.rb" "test/template/translation_helper_test.rb" "test/template/url_helper_test.rb" 
/vagrant/rails/actionview/test/template/url_helper_test.rb:530: warning: method redefined; discarding old test_mail_to_with_html_safe_string
/vagrant/rails/actionview/test/template/url_helper_test.rb:518: warning: previous definition of test_mail_to_with_html_safe_string was here
Run options: --seed 46209

# Running:

.................................................................................................................................................................................................................lib/mathn.rb is deprecated
..........................................................................................................................................S.........................................................................................................................................................................................................................................................../vagrant/rails/actionview/test/template/form_helper_test.rb:952: warning: method redefined; discarding old id_came_from_user?
/vagrant/rails/actionview/test/template/form_helper_test.rb:110: warning: previous definition of id_came_from_user? was here
.......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

Finished in 36.605760s, 42.7802 runs/s, 97.3344 assertions/s.

1566 runs, 3563 assertions, 0 failures, 0 errors, 1 skips

You have skipped tests. Run with --verbose for details.
/usr/bin/ruby2.3 -w -I"lib:test" -I"/var/lib/gems/2.3.0/gems/rake-10.4.2/lib" "/var/lib/gems/2.3.0/gems/rake-10.4.2/lib/rake/rake_test_loader.rb" "test/actionpack/abstract/abstract_controller_test.rb" "test/actionpack/abstract/helper_test.rb" "test/actionpack/abstract/layouts_test.rb" "test/actionpack/abstract/render_test.rb" "test/actionpack/controller/capture_test.rb" "test/actionpack/controller/layout_test.rb" "test/actionpack/controller/render_test.rb" "test/actionpack/controller/view_paths_test.rb" 
Run options: --seed 54729

# Running:

.................................................................................................................................................F..........................................................................

Finished in 4.889107s, 44.9980 runs/s, 62.7926 assertions/s.

  1) Failure:
RenderTest#test_render_action_upcased [/vagrant/rails/actionview/test/actionpack/controller/render_test.rb:742]:
ActionView::MissingTemplate expected but nothing was raised.

220 runs, 307 assertions, 1 failures, 0 errors, 0 skips
rake aborted!
Command failed with status (1): [ruby -w -I"lib:test" -I"/var/lib/gems/2.3.0/gems/rake-10.4.2/lib" "/var/lib/gems/2.3.0/gems/rake-10.4.2/lib/rake/rake_test_loader.rb" "test/actionpack/abstract/abstract_controller_test.rb" "test/actionpack/abstract/helper_test.rb" "test/actionpack/abstract/layouts_test.rb" "test/actionpack/abstract/render_test.rb" "test/actionpack/controller/capture_test.rb" "test/actionpack/controller/layout_test.rb" "test/actionpack/controller/render_test.rb" "test/actionpack/controller/view_paths_test.rb" ]

Tasks: TOP => test => test:integration:action_pack
(See full trace by running task with --trace)
fxn commented 8 years ago

Excellent. I'll update the Vagrantfile with more memory. Looks like lately bundle install does not complete without increasing RAM.

Please note that in the current dev box the distro is "ubuntu/wily64".

Regarding the tests, skips are a decision of the project. The failure in Action View is known, it has to do with running a case-insensitive filesystem in Linux basically. Please do ignore that one, your setup seems to be fine.