Have a strange problem in that I have a Rake task that seems to be using multiple versions of Ruby. When one fails, it seems to try another one.
Details
MacBook running 10.6.5
rvm 1.1.0
Rubies: 1.8.7-p302, ree-1.8.7-2010.02, ruby-1.9.2-p0
Rake 0.8.7
Gem 1.3.7
Veewee (provisioning Virtual Machines using Opcode.com, Vagrant and Chef)
I'm not entirely sure the specific details of the error matter, but since it might be an issue with Veewee itself. So, what I'm trying to do is build a new box base on a veewee definition. The command fails with an error about a missing method- but what's interesting is how it fails.
Errors
I managed to figure out that if I only have one Ruby installed with RVM, it just fails. If I have more than one Ruby install, it fails at the same place, but execution seems to continue in another interpreter.
Here are two different clipped console outputs. I've clipped them for size. The full outputs of each error are available as a gist.
One Ruby version installed
Here is the command run when I only have a single version of Ruby (1.8.7) available in RVM
boudica:veewee john$ rvm rake build['mettabox'] --trace
rvm 1.1.0 by Wayne E. Seguin (wayneeseguin#gmail.com) [http://rvm.beginrescueend.com/]
(in /Users/john/Work/veewee)
** Invoke build (first_time)
** Execute build
…
creating new harddrive
rake aborted!
undefined method `max_vdi_size' for #<VirtualBox::SystemProperties:0x102d6af80>
/Users/john/.rvm/gems/ruby-1.8.7-p302/gems/virtualbox-0.8.3/lib/virtualbox/abstract_model/dirty.rb:172:in `method_missing'
<------ stacktraces cut ---------->
/Users/john/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.8.7/bin/rake:31
/Users/john/.rvm/gems/ruby-1.8.7-p302#global/bin/rake:19:in `load'
/Users/john/.rvm/gems/ruby-1.8.7-p302#global/bin/rake:19
Multiple Ruby Versions
Here is the same command run with three versions of Ruby available in RVM. Prior to doing this, I used "rvm use 1.8.7." Again, I don't know how important the details of the specific errors are- what's interesting to me is that there are three separate errors- each with it's own stacktrace- and each in a different Ruby interpreter. Look at the bottom of each stacktrace and you'll see that they are all sourced from different interpreter locations- First ree-1.8.7, then ruby-1.8.7, then ruby-1.9.2:
boudica:veewee john$ rvm rake build['mettabox'] --trace
rvm 1.1.0 by Wayne E. Seguin (wayneeseguin#gmail.com) [http://rvm.beginrescueend.com/]
(in /Users/john/Work/veewee)
** Invoke build (first_time)
** Execute build
…
creating new harddrive
rake aborted!
undefined method `max_vdi_size' for #<VirtualBox::SystemProperties:0x1059dd608>
/Users/john/.rvm/gems/ree-1.8.7-2010.02/gems/virtualbox-0.8.3/lib/virtualbox/abstract_model/dirty.rb:172:in `method_missing'
…
/Users/john/.rvm/gems/ree-1.8.7-2010.02/gems/rake-0.8.7/bin/rake:31
/Users/john/.rvm/gems/ree-1.8.7-2010.02#global/bin/rake:19:in `load'
/Users/john/.rvm/gems/ree-1.8.7-2010.02#global/bin/rake:19
(in /Users/john/Work/veewee)
** Invoke build (first_time)
** Execute build
isofile ubuntu-10.04.1-server-amd64.iso is available
["a1b857f92eecaf9f0a31ecfc39dee906", "30b5c6fdddbfe7b397fe506400be698d"]
[]
Last good state: -1
Current step: 0
last good state -1
destroying machine+disks
(re-)executing step 0-initial-a1b857f92eecaf9f0a31ecfc39dee906
VBoxManage: error: Machine settings file '/Users/john/VirtualBox VMs/mettabox/mettabox.vbox' already exists
VBoxManage: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component Machine, interface IMachine, callee nsISupports
Context: "CreateMachine(bstrSettingsFile.raw(), name.raw(), osTypeId.raw(), Guid(id).toUtf16().raw(), FALSE , machine.asOutParam())" at line 247 of file VBoxManageMisc.cpp
rake aborted!
undefined method `memory_size=' for nil:NilClass
/Users/john/Work/veewee/lib/veewee/session.rb:303:in `create_vm'
/Users/john/Work/veewee/lib/veewee/session.rb:166:in `build'
/Users/john/Work/veewee/lib/veewee/session.rb:560:in `transaction'
/Users/john/Work/veewee/lib/veewee/session.rb:163:in `build'
/Users/john/Work/veewee/Rakefile:87
/Users/john/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/Users/john/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
/Users/john/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.8.7/lib/rake.rb:631:in `each'
…
/Users/john/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.8.7/bin/rake:31
/Users/john/.rvm/gems/ruby-1.8.7-p302#global/bin/rake:19:in `load'
/Users/john/.rvm/gems/ruby-1.8.7-p302#global/bin/rake:19
(in /Users/john/Work/veewee)
** Invoke build (first_time)
** Execute build
isofile ubuntu-10.04.1-server-amd64.iso is available
["a9c4ab3257e1da3479c984eae9905c2a", "30b5c6fdddbfe7b397fe506400be698d"]
[]
Last good state: -1
Current step: 0
last good state -1
(re-)executing step 0-initial-a9c4ab3257e1da3479c984eae9905c2a
VBoxManage: error: Machine settings file '/Users/john/VirtualBox VMs/mettabox/mettabox.vbox' already exists
VBoxManage: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component Machine, interface IMachine, callee nsISupports
Context: "CreateMachine(bstrSettingsFile.raw(), name.raw(), osTypeId.raw(), Guid(id).toUtf16().raw(), FALSE , machine.asOutParam())" at line 247 of file VBoxManageMisc.cpp
rake aborted!
undefined method `memory_size=' for nil:NilClass
/Users/john/Work/veewee/lib/veewee/session.rb:303:in `create_vm'
/Users/john/Work/veewee/lib/veewee/session.rb:166:in `block in build'
/Users/john/Work/veewee/lib/veewee/session.rb:560:in `transaction'
/Users/john/Work/veewee/lib/veewee/session.rb:163:in `build'
/Users/john/Work/veewee/Rakefile:87:in `block in <top (required)>'
/Users/john/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/rake.rb:634:in `call'
/Users/john/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/rake.rb:634:in `block in execute'
…
/Users/john/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/rake.rb:2013:in `top_level'
/Users/john/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/rake.rb:1992:in `run'
/Users/john/.rvm/rubies/ruby-1.9.2-p0/bin/rake:35:in `<main>'
It isn't until we reach the last installed version of Ruby that execution halts.
Discussion
Does anyone have any idea what's going on here? Has anyone seen this "failover"-like behavior before? It seems strange to me that the first exception would not halt execution as it did with one interpreter, but I wonder if there are things happening when RVM is installed that we Ruby developers are not considering.
Since rvm rake is SUPPOSED to run the rake task against all versions of Ruby under RVM's control I think it's doing what is expected: rvm help shows:
rake - runs a rake task against specified and/or all rubies
Specifically requesting help for rake shows:
$ rvm help rake
Rake
RVM allows you to run rake tasks across multiple ruby versions, for example:
∴ rvm 1.8.6,1.9.1 rake spec
JSON Summary
Adding a --json flag prior to the word 'rake' and a JSON summary will be printed out at the end of the run.
YAML Summary
Adding a --yaml flag prior to the word 'rake' and a YAML summary will be printed out at the end of the run.
If you are trying to run a rake task, you do not have to involve RVM. Set your desired Ruby version with RVM first, then run the task:
rvm 1.9.2
rake some_task
the error you are mentioning is not a problem of different ruby vms.
Could it be you have upgrade to Virtualbox 4.X because the new vagrant needs it?
Some functions of the virtualbox on which veewee is dependent are (not yet) ported to Virtualbox 4.x
I'm working around this now by execing the virtualbox commands directly. Funny that while implementing the update, I hit the exact same error.
Patrick (veewee inspirator)
Related
I'm trying to use fastlane on Windows, which is installed from Bundler -- which is installed by Ruby Gem. But while running, some internal error of Ruby seems blocked the execution.
First, I went to Ruby Installer and installed Ruby+Devkit 3.0.2-1 (x64); then, I installed the Bundler and Fastlane using gem command. Error below happened when I was trying to execute them -- which I believed was not related to Bundler nor Fastlane:
C:/Ruby30-x64/lib/ruby/3.0.0/reline/ansi.rb:157:in `winsize': Bad file descriptor - <STDIN> (Errno::EBADF)
from C:/Ruby30-x64/lib/ruby/3.0.0/reline/ansi.rb:157:in `get_screen_size'
from C:/Ruby30-x64/lib/ruby/3.0.0/reline.rb:168:in `get_screen_size'
from C:/Ruby30-x64/lib/ruby/3.0.0/forwardable.rb:238:in `get_screen_size'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/tty-screen-0.8.1/lib/tty/screen.rb:236:in `size_from_readline'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/tty-screen-0.8.1/lib/tty/screen.rb:66:in `size'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/tty-screen-0.8.1/lib/tty/screen.rb:76:in `width'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/fastlane-2.197.0/fastlane_core/lib/fastlane_core/print_table.rb:95:in `transform_output'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/fastlane-2.197.0/fastlane/lib/fastlane/plugins/plugin_manager.rb:335:in `print_plugin_information'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/fastlane-2.197.0/fastlane/lib/fastlane/plugins/plugin_manager.rb:316:in `load_plugins'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/fastlane-2.197.0/fastlane/lib/fastlane/commands_generator.rb:39:in `start'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/fastlane-2.197.0/fastlane/lib/fastlane/cli_tools_distributor.rb:122:in `take_off'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/fastlane-2.197.0/bin/fastlane:23:in `<top (required)>'
from C:/Ruby30-x64/bin/fastlane:23:in `load'
from C:/Ruby30-x64/bin/fastlane:23:in `<main>'
I'm using Windows 10 home version 20H2.
Rebooting the computer doesn't solve the problem.
I tried googling the question, but it seems that problem hasn't be reported (or be answered). I don't know where I can report the bug either.
What can I do? Any help would be appreciated!
I had this same error when I tried running bundle exec fastlane in git bash.
I got it working by running it in powershell instead.
I have a ruby gem that adds some default rake tasks. I also have some basic integration tests checking the output of rake -T and rake -AT for each of these tasks.
In order to farm out these tasks from some Ruby source code, I chose to use PTY.spawn and captured the stdout and stderr output to streams.
As you might see here on the Travis build:
Failure/Error: Paint.unpaint(out.read)
Errno::EIO:
Input/output error # io_fread - /dev/pts/1
# ./spec/spec_helper.rb:184:in `read'
# ./spec/spec_helper.rb:184:in `run_command'
# ./spec/rake/test_spec.rb:4:in `block (2 levels) in <top (required)>'
This is one of the first times I've used the Travis CI runner, so I tried manually requiring it to install libreadline too. I've updated bundler, rubygems, and have run this on multiple versions of ruby with the exact same error.
Per the constraints of one of my dependencies, I tested against MRI 2.2, 2.3, and 2.4. All of them failed the same way on travis, but also tried them on my local machine (MacOS) using chruby with no problem.
What am I missing?
I have installed ruby 2.2.5 / gem 2.3.0 in CygWin but I am getting installation errors in using gem install.
As suggested in some places, I also tried gem update --system but even that did not help.
How to correct this issue?
I have attached the output of the commands I ran:
$ gem install napa --backtrace
ERROR: While executing gem ... (TypeError)
no implicit conversion of nil into String
/usr/local/share/ruby/site_ruby/rubygems/installer.rb:168:in `check_executable_overwrite'
/usr/local/share/ruby/site_ruby/rubygems/installer.rb:409:in `block in generate_bin'
/usr/local/share/ruby/site_ruby/rubygems/installer.rb:396:in `each'
/usr/local/share/ruby/site_ruby/rubygems/installer.rb:396:in `generate_bin'
/usr/local/share/ruby/site_ruby/rubygems/installer.rb:236:in `install'
/usr/local/share/ruby/site_ruby/rubygems/request_set.rb:156:in `block in install'
/usr/local/share/ruby/site_ruby/rubygems/request_set.rb:140:in `each'
/usr/local/share/ruby/site_ruby/rubygems/request_set.rb:140:in `install'
/usr/local/share/ruby/site_ruby/rubygems/commands/install_command.rb:249:in `install_gem'
/usr/local/share/ruby/site_ruby/rubygems/commands/install_command.rb:291:in `block in install_gems'
/usr/local/share/ruby/site_ruby/rubygems/commands/install_command.rb:287:in `each'
/usr/local/share/ruby/site_ruby/rubygems/commands/install_command.rb:287:in `install_gems'
/usr/local/share/ruby/site_ruby/rubygems/commands/install_command.rb:202:in `execute'
/usr/local/share/ruby/site_ruby/rubygems/command.rb:307:in `invoke_with_build_args'
/usr/local/share/ruby/site_ruby/rubygems/command_manager.rb:167:in `process_args'
/usr/local/share/ruby/site_ruby/rubygems/command_manager.rb:137:in `run'
/usr/local/share/ruby/site_ruby/rubygems/gem_runner.rb:54:in `run'
/usr/bin/gem:21:in `<main>'
$ gem update --system
Updating rubygems-update
ERROR: While executing gem ... (TypeError)
no implicit conversion of nil into String
Skip to the bottom for the short answer and not join me on my journey.
So I've been working on this today because for the life of me, what worked last year to get it working did not work this year. All the steps are attempted while using admin permissions. I had done some questionable commands from other threads that required me to downgrade gem to something 6 years ago, don't do that I could not figure out how to revert so I deleted my Cygwin install and started fresh and clean for this. Windows 10 is my operating system.
I used cygwin's installer to install the current version of ruby, gem and sass. (I'm positive as time goes on these will numbers will become out of date).
ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-cygwin]
ruby-devel 2.3.3-1
gem 2.6.11
Sass 3.4.21 selective steve
Side note I tend to use 'Category' under the View drop down and select the devel category. I also let cygwin select dependencies for me automatically.
At this point I am having the same error. Looking at the log provided by the output I decided to try out some of the commands smashed in there like 'gcc' which was absent. Loading up the cygwin installer again, installed gcc version 5.4.0 (Package called gcc-core: GNU Compiler Collection (C, OpenMP))
Attempting to run 'gem install compass' again, another error, it cant find 'make'. Warm up the installer again and locate 'make: The GNU Version of the 'make' utility (4.2.1-2)
Running the compass install command again and checking the log: 'libffi' doesnt look like its there. In our cygwin installer says under the libs category I have libffi6 v2.2.1-2 already. I'm going to give libffi-devel a shot because I'm desperate to get compass installed.
This worked! Navigate to your directory and run the command 'compass watch' I'm pretty excited. Running 'compass -v' in the command line shows us the version 1.0.3
Short answer:
Useing the Cygwin installer to install the following Packages
ruby: interpreted object oriented scripting language
ruby-devel: interpreted object oriented scripting language
ruby-gems: Ruby Module management system
ruby-sass: Ruby css compiler extension
make: The GNU version of the make utility
gcc-core: GNU Compiler Collection(c, OpenMP)
libffi-devel: Portable foreign function interface libary
Then run cygwin as a administrator and input the command 'gem install compass'.
My company need to upgrade their current Redmine1.1.1 server. In order to avoid productions issue, I am trying to recreate a working instance with identical version. That's why I can't use standard solution which mainly modify the gems or rail version.
I need to create an instance of a redmine-1.1.1 CentOS6 server with the following rubygems version:
[root#localhost redmine1]# rpm -qa |grep ruby
rubygem-rack-1.1.0-2.el6.noarch
rubygem-daemon_controller-1.1.5-1.el6.noarch
rubygems-1.3.7-5.el6.noarch ruby-ri-1.8.7.374-4.el6_6.i686
ruby-1.8.7.374-4.el6_6.i686 rubygem-rake-0.8.7-2.1.el6.noarch
ruby-mysql-2.8.2-1.el6.i686 ruby-irb-1.8.7.374-4.el6_6.i686
rubygems-devel-1.3.7-5.el6.noarch ruby-devel-1.8.7.374-4.el6_6.i686
rubygem-passenger-3.0.21-11.el6.i686
rubygem-passenger-native-libs-3.0.21-11.el6.i686
ruby-rdoc-1.8.7.374-4.el6_6.i686 ruby-docs-1.8.7.374-4.el6_6.i686
rubygem-passenger-native-3.0.21-11.el6.i686
ruby-libs-1.8.7.374-4.el6_6.i686 rubygem-fastthread-1.0.7-2.2.i686
I followed the tutorials below in order to recreate the redmine install.
https://www.redmine.org/projects/redmine/wiki/Redmine+Apache+Passenger_InstallOnRedHat
http://www.redmine.org/projects/redmine/wiki/HowTo_install_Redmine_on_CentOS_5
I got this error and knowing that I can't downgrade my gems, what are the other options to overcome this?
[root#localhost redmine1]# rake generate_session_store
rake aborted!
undefined method `source_index' for Gem:Module
/var/www/redmine1/config/../vendor/rails/railties/lib/rails/gem_dependency.rb:21:in
`add_frozen_gem_path' /var/www/redmine1/config/boot.rb:47:in
`load_initializer' /var/www/redmine1/config/boot.rb:38:in `run'
/var/www/redmine1/config/boot.rb:11:in `boot!'
/var/www/redmine1/config/boot.rb:122 /var/www/redmine1/Rakefile:4
/usr/local/rvm/gems/ruby-1.8.7-head#redmine111/bin/ruby_executable_hooks:15
(See full trace by running task with --trace)
What are the necessary complements to help you understand this issue?
I have ruby 2.0.0p247 [x64-mingw32] with Gem 2.2.2 installed on Windows 8. I have a persistent problem gem that is making it virtually unusable. Whenever I try to install a new gem, I invariably get:
ERROR: While executing gem ... Invalid spec cache file in C:/Users/...
In the past, I've been able to run gem update or gem update --system and that would clear up the problem for one, single gem install. Subsequent install would fail with the same error. Now even gem update fails with that error message.
I've tried deleting the users/.../.gem directory. When I do that, gem update recreates that directory and promptly fails with the same error message.
I re-installed ruby 1.9.8 with gems several times to try to cure the problem, then upgraded to ruby 2.0.0. Throughout all re-installs and upgrades, the problem persisted.
I'm at my wits end here. Can anyone help me resolve this issue?
Here's the backtrace on the edit"
L:\xampp\htdocs\frameworks\yii2\framework>gem update --backtrace
Updating installed gems
ERROR: While executing gem ... (Gem::Exception)
Invalid spec cache file in C:/Users/Larry/.gem/specs/rubygems.org%443/specs.4.8
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/source.rb:187:in `rescue in load_specs'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/source.rb:179:in `load_specs'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/spec_fetcher.rb:266:in `tuples_for'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/spec_fetcher.rb:228:in `block in available_specs'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/source_list.rb:97:in `each'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/source_list.rb:97:in `each_source'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/spec_fetcher.rb:222:in `available_specs'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/spec_fetcher.rb:102:in `search_for_dependency'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/commands/update_command.rb:113:in `fetch_remote_gems'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/commands/update_command.rb:135:in `highest_remote_version'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/commands/update_command.rb:264:in `block in which_to_update'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/commands/update_command.rb:260:in `each'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/commands/update_command.rb:260:in `which_to_update'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/commands/update_command.rb:96:in `execute'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/command.rb:305:in `invoke_with_build_args'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/command_manager.rb:167:in `process_args'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/command_manager.rb:137:in `run'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/gem_runner.rb:54:in `run'
C:/Ruby200-x64/bin/gem:21:in `<main>'
I had the same problem, but was able to fix it this way:
Delete the folder in users/%user%/.gem/ and rerun the command gem sources --update
Hope this helps.