Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use and run_command don't work in rails console or rake #2

Closed
hbarrington opened this issue Mar 29, 2012 · 6 comments
Closed

use and run_command don't work in rails console or rake #2

hbarrington opened this issue Mar 29, 2012 · 6 comments
Assignees

Comments

@hbarrington
Copy link

running the following works in IRB but not rails console or rake
env = RVM::Environment.new('system')
env.shell_wrapper.run_command("cd ~/opscode/FTW && knife rackspace server list")

output shows:

[false, "", "/home/hunter/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/spec_set.rb:88:in `materialize': Could not find multi_json-1.2.0 in any of the sources (Bundler::GemNotFound)\n\tfrom /home/hunter/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/spec_set.rb:82:in `map!'\n\tfrom /home/hunter/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/spec_set.rb:82:in `materialize'\n\tfrom /home/hunter/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/definition.rb:90:in `specs'\n\tfrom /home/hunter/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/definition.rb:135:in `specs_for'\n\tfrom /home/hunter/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/definition.rb:124:in `requested_specs'\n\tfrom /home/hunter/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/environment.rb:23:in `requested_specs'\n\tfrom /home/hunter/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/runtime.rb:11:in `setup'\n\tfrom /home/hunter/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler.rb:110:in `setup'\n\tfrom /home/hunter/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/setup.rb:17\n/home/hunter/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/spec_set.rb:88:in `materialize': Could not find multi_json-1.2.0 in any of the sources (Bundler::GemNotFound)\n\tfrom /home/hunter/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/spec_set.rb:82:in `map!'\n\tfrom /home/hunter/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/spec_set.rb:82:in `materialize'\n\tfrom /home/hunter/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/definition.rb:90:in `specs'\n\tfrom /home/hunter/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/definition.rb:135:in `specs_for'\n\tfrom /home/hunter/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/definition.rb:124:in `requested_specs'\n\tfrom /home/hunter/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/environment.rb:23:in `requested_specs'\n\tfrom /home/hunter/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/runtime.rb:11:in `setup'\n\tfrom /home/hunter/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler.rb:110:in `setup'\n\tfrom /home/hunter/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/setup.rb:17\n"]

->

/home/hunter/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/spec_set.rb:88:in `materialize': Could not find multi_json-1.2.0 in any of the sources (Bundler::GemNotFound)
    from /home/hunter/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/spec_set.rb:82:in `map!'
    from /home/hunter/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/spec_set.rb:82:in `materialize'
    from /home/hunter/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/definition.rb:90:in `specs'
    from /home/hunter/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/definition.rb:135:in `specs_for'
    from /home/hunter/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/definition.rb:124:in `requested_specs'
    from /home/hunter/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/environment.rb:23:in `requested_specs'
    from /home/hunter/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/runtime.rb:11:in `setup'
    from /home/hunter/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler.rb:110:in `setup'
    from /home/hunter/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/setup.rb:17

my first guess is it has to do with bundler... i'll update if i find anything

@mpapis
Copy link
Member

mpapis commented Apr 3, 2012

does it work with other rubies ? I do not think system was ever supported in this scenario.

@ghost ghost assigned mpapis Apr 3, 2012
@hbarrington
Copy link
Author

I tried installing 1.8.7 and using that instead of system. seems to be the same error. Is there something I can run to get an idea of environment variables and see what might be the issue? Source code for the RVM gem doesn't suggest anything at first or second glance

@mpapis
Copy link
Member

mpapis commented Apr 6, 2012

@hbarrington here is part of the documentation i found https://github.com/wayneeseguin/rvm-gem/blob/master/lib/rvm.rb ... what I understood the run will be automatically used on current and you can change only gemsets with RVM.gemset_use! '1.9.3@project'

if you would like to have a selectable environments so you could invoke commands in they scope - this would require changes, please open new ticket for it.

@mpapis mpapis closed this as completed Apr 6, 2012
@hbarrington
Copy link
Author

used:
RVM.gemset_use! '1.8.7@knife'
env = RVM.current
puts(env.shell_wrapper.run_command("cd /home/hunter/opscode/FTW && knife rackspace server list"))

received the same error. Not sure exactly what you mean about "selectable environments so you could invoke commands". I thought that was the point of rvm. Am I missing something? A little documentation might help but I don't mind reading source

@mpapis
Copy link
Member

mpapis commented Apr 9, 2012

you can not change the loaded ruby version and you try to switch to 1.8.7 from 1.9.2 - this will not work, what you need is a possibility to select any ruby and allow running commands in context of this ruby, please open a new ticket for it

@hbarrington
Copy link
Author

@mpapis thanks for spelling it out for me... I wasnt making the connection. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants