-
-
Notifications
You must be signed in to change notification settings - Fork 374
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
Recipe fails on STDERR: sh: source: not found ---- End output of source /etc/profile.d/rvm.sh && rvm jruby-1.6.0@global gem env gempath ---- Ran source /etc/profile.d/rvm.sh && rvm jruby-1.6.0@global gem env gempath returned 127 #10
Comments
Hi there, are you running chef as non-root? Right now I was searching for a profile to source based on that assumption. I'll add a fallback to |
No Im actually running chef-solo as root, I am using zsh if that makes a difference, ill give the fallback a try Thanks! |
Ok iv found the issue, it does seem to be related to the fact that my default shell is zsh see http://www.ruby-forum.com/topic/203002 the fix is to use: gem_binary "/bin/bash -c 'source #{profile}' && rvm #{ruby_string} gem" Since source is bash specific feature, Iv sent you a pull request |
Looks like you tracked it down and pull request fix appears good. |
Thanks again |
Having problems related to this fix:
The problem is that won't work because it is executing |
Reverting to the old code: The problem with passing the entire command to An additional problem is that this provider is being invoked to install global gems, so we need RVM's This causes another problem: However, this still fails for me: I'm not sure what's wrong. If I run it from ssh it returns the correct path, so I assume it has something to do with the environment that Chef is running under. I might spend more time to look at it later but for now I'm just going to disable gem installs. |
I'm trying to get this to work with Vagrant as well, and I've got the same issue. |
Here is a workaround (for the vagant issues): https://github.com/fnordfish/vagrant-soup/blob/master/roles/ruby_devel.rb It basically makes sure that bundler is installed as a global gem |
The workaround works for me! Awesome. |
Works for me too! |
@wsc that's exactly what I thought would happen while sub-processing the sourcing of rvm.sh. I'm hoping to get a few minutes at home tonight to tie this off, or dig deeper :) I ran into problems with RVM and pre-made vagrant boxes which I eventually solved for myself in a vagrant_extras recipe. Is it worth adding some minor helpers in the rvm cookbook to help vagrant work better out of the gate? I'm starting to think that could be helpful. |
Another issue (with JRuby specifically) after the workaround is implemented: #16 Normal rubies like REE, 1.9.2, etc. work fine. UPDATE: scratch that, I'm an idiot. |
Ah, here's why it works regardless of the "all sudo requests are now loaded in a "login" shell so that if system-wide RVM is setup, then the bash_profile should be loaded to setup ruby to execute the proper RVM-managed ruby." |
@wsc, right I remember reading that pull request and not totally understanding it at the time :) I'm doing some experimenting with a more traditional Chef provider for this resource. That would allow me to get at the Out of curiosity, what is everyone's target chef environments? I'm primarily testing things out with the stock lucid32 Vagrant image and chef 0.9.12. My day-to-day vagrant and production VMs are Ubuntu 10.10 x32 with chef 0.9.16 (at the moment). Just curious if there are any platform differences we should account for. |
Similar here: stock lucid64 Vagrant image and whatever the latest version of chef is. |
@fnordfish the reason your fix works is the second chef run, the chef gem is found in the default rvm ruby's global gemset. Without it, the system ruby is effectively "hidden" under the RVM default. Another possible solution that I am using is this chef-solo wrapper script it gets put higher in PATH at /usr/local/bin/chef-solo and calls the system (apt installed) ruby's chef gem which was provided by the vagrant base box. Mind bender :) |
I tried an alternate approach with this one. I created a new old school-style provider for rvm_gem which extends |
I'm going to be brave and assume that we're all resolved. If not, then please re-open. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
The recipe fails when trying to install the bundler gem (this happens also on 1.9.2 not just jruby)
[Sat, 02 Apr 2011 14:02:52 +0000] ERROR: rvm_gem[bundler](/home/ronen/chef-meta/external/cookbooks/rvm/recipes/default.rb:51:in `from_file') had an error:
Expected process to exit 0, but it exited with 127
---- Begin output of source /etc/profile.d/rvm.sh && rvm jruby-1.6.0@global gem env gempath ----
STDOUT:
STDERR: sh: source: not found
---- End output of source /etc/profile.d/rvm.sh && rvm jruby-1.6.0@global gem env gempath ----
The text was updated successfully, but these errors were encountered: