Skip to content
This repository has been archived by the owner on May 15, 2020. It is now read-only.

Pow ignoring rvm #271

Closed
bardsley opened this issue Mar 26, 2012 · 40 comments
Closed

Pow ignoring rvm #271

bardsley opened this issue Mar 26, 2012 · 40 comments

Comments

@bardsley
Copy link

Ok just to say I have spent 4 days looking for fixes so I realise this has been looked at before and closed

I am getting the

/System/Library/Frameworks/Ruby.framework/Versions/1.8....

I have tried a reinstall of everything including different version of ruby and rvm. everything is now on latest versions
I have also added the RVM botoing to .zshenv and hardcoded the path
I have downloaded and installed from source the latest head of pow and get the following output from the new (and very useful) /env.json


{"rvm_bin_path":"/Users/bardsley/.rvm/bin",
"TERM":"su",
"SHELL":"/bin/zsh",
"http_proxy":"wwwcache.lancs.ac.uk:8080",
"USER":"bardsley","__array_start":"1","rvm_path":
"/Users/bardsley/.rvm","escape_flag":"1","rvm_prefix":"/Users/bardsley",
"PATH":"/Users/bardsley/.rvm/bin:/usr/local/mysql/bin:/usr/local/git/bin:/Library/PostgreSQL/9.0/bin:/opt/local/bin:/Applications/bin:/Users/bardsley/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/Users/bardsley/.rvm/bin",
"PWD":"/Users/bardsley","_second":"2",
"https_proxy":"wwwcache.lancs.ac.uk:8080",
"rvm_version":"1.11.3 ()","SHLVL":"1",
"HOME":"/Users/bardsley",
"DYLD_LIBRARY_PATH":"/usr/local/mysql/lib/",
"_first":"1",
"LOGNAME":"bardsley","RUBYLIB":"/usr/local/lib:","_":"/usr/bin/env"}

I have also tried rackup in the project directory and it runs fine

I am having the same problem across all of our apps as well

Any suggestion sother than "have you tried rbenv" are welcomed

@memoht
Copy link

memoht commented Mar 26, 2012

I would like to confirm that I am having the same problem I read in this issue.

I just updated my RVM to 1.11.3 and all of my sites using Pow are broken. I can start them without Pow. I have followed the troubleshooting tips to no avail. All I see when I go to my apps is:

Error starting application
Your Rack app raised an exception when Pow tried to run it.
LoadError: no such file to load -- bundler/setup
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:inrequire'
~/Sites/ppigraphics/config/boot.rb:6
~/Sites/ppigraphics/config/application.rb:1:in `require'
~/Sites/ppigraphics/config/application.rb:1

@memoht
Copy link

memoht commented Mar 26, 2012

One of the RVM guys (@mpapis) just helped me solve this issue. He had me comment out line #9 of my Users/myname/.rvm/scripts/rvm file. He concluded this is a POW issue and that I would need to repeat the fix each time I updated RVM.
His exact words, that did the trick.

  • edit $rvm_path/scripts/rvm
  • on line 9 there is: [[ ":$SHELLOPTS:" =~ ":posix:" ]] && return 0 || true
  • comment it out: # [[ ":$SHELLOPTS:" =~ ":posix:" ]] && return 0 || true
  • and then refresh the page

@mpapis
Copy link

mpapis commented Mar 26, 2012

the issue is that POW tries to load RVM in an limited shell - SH, this was never supported by RVM, but we had to disable it explicitly because of problems in starting X server in Fedora 16

RVM supports Bash and Zsh, any other shells are not tested neither supposed to work (SH is not supported).

@bardsley
Copy link
Author

After disabling this line I do indeed get it back up but then when I reload pow I get Application not found for all aps

The fix is to unpatch RVM load pow then patch RVM. This is not a great solution for me. Are you getting any problems if you restart pow?

@bardsley
Copy link
Author

Latest bleeding edge POW still needs the fix but now doesnt lose my Apps once it runs

@simontseng
Copy link

same issue here
i downgraded rvm to 1.10.x for now

@victorlhlam
Copy link

i have the same issue...... @simontseng May I know how to downgrade? I searched the web and can't find any resource.

@simontseng
Copy link

http://beginrescueend.com/rvm/install/

read "Installing a specific version:"

@victorlhlam
Copy link

ooops. Thanks @simontseng :)

@mreinsch
Copy link

@Aesthetica thanks! 👍

@kossnocorp
Copy link

Works for me:

bash -s -- --version 1.10.3 < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer )

@libin
Copy link

libin commented Apr 4, 2012

Equals to

rvm get 1.10.3

@lailsonbm
Copy link

Downgrading to 1.10.3 worked for me too.

@LBRapid
Copy link

LBRapid commented Apr 6, 2012

Fixed problems I was having as well.

@simontseng
Copy link

does anyone know if this issue going to be resolved? is it solved in edge version of pow? or should this be an rvm issue?

i guess not updating rvm forever should be the solution

@mpapis
Copy link

mpapis commented Apr 8, 2012

From what I understood RVM support might get dropped anyway: #236

According to http://pow.cx/manual you should be able to source proper environment file from .powrc / .powenv, run this in project root:

rvm env . -- --env > .powenv

I do not use pow so I did not had chance to test it, but it should work after touch tmp/restart.txt

@mreinsch
Copy link

mreinsch commented Apr 9, 2012

that would be quite disappointing actually. Pow is supposed to make it dead easy to get rails apps up and running on a dev machine, no?

@mpapis
Copy link

mpapis commented Apr 9, 2012

according to the docs - http://pow.cx/manual it would require you to type for every changes in code touch tmp/restart.txt

or do it once: touch tmp/always_restart.txt - but i heard this one makes it really slow, but test it yourself, which one is better for you ...

In the end rails s might be the same - but does not require pow... and if you have alias r=rails it's just r s to get your app started ...

finally pow is available only on osx, if you do some work with linux (like via vagrant) then you need to learn back to standard ways.

@simontseng
Copy link

didn't know this is because pow is moving away from rvm
thanks for the tips mpapis

@simontseng
Copy link

the .powrc solution does make sense
and i am trying to adjust my workflow to see if it works for me
and moving back to stable rvm now

@simontseng
Copy link

dropping rvm support does make sense to me
ruby build management tools should manage environment transparently for user anyway even to webserver
otherwise it is endless nightmare to support when there is new build management tool
as long as there is alternative solution removing a explicit rvm support is a good decision

@dyba
Copy link

dyba commented Apr 14, 2012

::watching::

@thatothermitch
Copy link

I've had luck dumping the rvm environment into the .powenv file from the .rvmrc:

rvm env -- [ruby]@[gemset] > .powenv

This way POW will be automatically configured for your local environment as RVM is being configured.

I've tested this workaround with success on RVMs 1.11.x and 1.12.x using POW 0.4.0

@ezkl
Copy link

ezkl commented Apr 18, 2012

@thatothermitch's solution works for me w/ rvm v1.12.3 and Pow v0.4.0-pre

@ccahoon
Copy link

ccahoon commented Apr 21, 2012

@thatothermitch's solution worked for me, too. rvm 1.12.4 and Pow v0.3.2.

@iphoting
Copy link

@thatothermitch's solution worked on rvm 1.12.5 and pow v0.3.2.

Can the docs be updated with rvm env -- [ruby]@[gemset] > .powenv under the RVM section? It'll save a lot of time for new users with RVM.

@RobertLowe
Copy link

Just hit this. Also a co-worker hit this a week ago and switched to rbenv. I'm not ready to move. Can we get a friendly minor patch?

+1

@anujluthra
Copy link

rvm and pow singing -- Why can't we be friends !!!

@jondkinney
Copy link

@thatothermitch's solution worked for me, too.

@bardsley
Copy link
Author

Summary:

  • rvm isn't going to start supporting SH anytime soon
  • pow is pretty heavily tied into starting with SH at the moment
  • @thatothermitch solutions of using rvm env -- [ruby]@[gemset] > .powenv works for people
  • Simply downgrading to RVM 1.10.x also fixes it (info at http://beginrescueend.com/rvm/install/ -> isnatlling a specific version

@alexschomb
Copy link

I'd like to note that the solution of @thatothermitch didn't work with my ZSH shell:

$ rvm env -- [ruby]@[gemset] > .powenv
zsh: no matches found: [ruby]@[gemset]

But it works when running it in bash:

$ bash -s
$ rvm env -- [ruby]@[gemset] > .powenv

@jondkinney
Copy link

@alexschomb at the risk of insulting you (sorry if that's the case) you need to use a real version of ruby and a real gemset name... so if your app's gemset was 'my_cool_app' and you wanted to use Ruby 1.9.3 patch level 125 then it'd be:

rvm env -- 1.9.3-p125@my_cool_app > .powenv

Worked a treat for my zsh

@alexschomb
Copy link

@J2Fly No worries, you can't insult me that way ;)

At first I thought the same, but on my zsh it didn't even work when replacing it with real versions and gemsets. I'm quite unsure what I did wrong here. Although it works like a charm in bash even without replacing the [ruby]@[gemset] part. I'm no bash scripting expert at all, but I guess that bash replaces the parameters automatically where zsh can't (or uses a different syntax).

@jondkinney
Copy link

You know you might be right, it might pick out the version of ruby and the gemset for you based on your current rvm env settings. Running it with explicit versions when I tried it fixed me right up though so I can't speak to whether or not that is how it's supposed to work.

@sstephenson
Copy link
Contributor

Fixed in 584a40d.

For the record, this kind of bug—stemming from poorly-defined or nonexistent APIs between RVM and the rest of the world—is exactly why I wrote rbenv, and why we'll be dropping automatic RVM support in a future Pow release.

@memoht
Copy link

memoht commented Jun 4, 2012

For the record, Pow hadn't been updated in like 9 months. RVM is regularly updated and it's creators are very helpful. Non-existent APIs vs. non-existent updates. Hmmm... buh-bye Pow.

@sstephenson
Copy link
Contributor

@Aesthetica Open-source software is provided free of charge for you to do with as you please. Use it or don't. No one owes you anything.

@memoht
Copy link

memoht commented Jun 4, 2012

I am fully aware and appreciate that open-source software is free and realize that I couldn't code a replacement for Pow or RVM much less build a gem. I just think your comment stepping on RVM seems heavy handed.

sujal pushed a commit to sujal/pow that referenced this issue Jun 6, 2012
@haggen
Copy link

haggen commented Apr 4, 2013

What if I'm getting this issue while using rbenv ? :(

@mklickman
Copy link

@haggen - from the Pow user manual:

"The rbenv local command lets you set a per-project Ruby version by saving an .rbenv-version file in the current directory."

Here's the full entry: http://pow.cx/manual.html#section_2.3.1

Hope that helps; I'd offer some specific tips, but I'm more of an RVM guy myself, sorry!

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

No branches or pull requests