I have a static application that I'm trying to add the webby gem to. I setup local gems (based on the recommended way in another question), but gem install webby doesn't seem to install the command only the documentation. Webby builds a static site (all I need for this), but supports some templating and things of that nature. I don't need rails. ps. I'm historically a Windows dude, so please humor me. asked 22 Mar '11, 23:35 cromwellryan
showing 5 of 14
show 9 more comments
|
There were two problems. The first was that I had created an SSH account with the bin/sh shell. This caused my .bash_profile not to be loaded. I really don't know what the bin/sh shell is, but it seemed close to ssh, so I picked it. Obviously need to read up there. The second was that my deploy.rb for capistrano had this line: default_run_options[:pty] = true that keeps your profile from loading. Once I did those things, I was golden. answered 28 Mar '11, 13:05 cromwellryan The shell you are used to using is called bash,(born again shell) the sh program is the older, shell. It does not have all the defaults bash has. There are a few others too, but bash and sh are the most common. Thanks for letting us know your fix.
(28 Mar '11, 13:09)
johns
|
Hi,
Can you give us the exact command you ran to install it? If you'd feel better about not putting your user info here you can send us a ticket. :)
Sure. SSH into the server, then gem install webby. Or are you referring to the install of local gems?
gem list shows webby 0.9.4. I wonder if there is a path problem. Since it's a static site, the last two steps of http://community.webfaction.com/questions/1741/how-to-install-rubygems-locally didn't seem to apply. I'm referring to the recommended way in there.
Hi,
It looks like your PATH may not be including your gem path or your ruby lib path. Can you give me the out put of "echo $PATH"?
This is $PATH after installing gems to /webapps/<app>/current /home/cincycleancode/webapps/cincycleancoders/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin
Oddly enough I used --prefix=$HOME/webapps/cincycleancode/current when installing local gems, but the bin path is not under current.
Restarting the shell I lose the first path and get: /usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin
Current is a result off the capistrano deployment.
any thoughts?
Hi,
You can retain environment variables between sessions if you add them to your .bashrc so adding
export /home/cincycleancode/webapps/cincycleancoders/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin
to /home/cincycleancode/.bashrc would help.
So I've done this, but I don't know how to get it to reload the path. When I jump back into ssh, $PATH doesn't have what I placed in .bashrc which is:
PATH=$PATH:$HOME/.gem/ruby/1.8/bin
.bashrc is for 'remote connections', things like git or another program using SSH as your user. .bash_profile is for user sessions, so you will also want to add the changes to .bash_profile to make them apply when you login using SSH.
Gave tha a try, but I'm doing something wrong.
Here's both files right now.
https://gist.github.com/889910
I leave ssh via exit and log back in. $PATH returns: /usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin
So I just noticed that my .bash_profile isn't even being loaded when I ssh in.
. .bash_profile changes my prompt and adds everything to the path. WTF?
Same goes for . .bashrc.
Hi,
Your .bash* stuff should be run each time you log in. Is there anything particular about the way you are logging in that we could use to look into this a little further? Are you using keys or a password? Which program are you using to log in?
I figured out this problem at least. I created a specific ssh account that I wanted to use for the app. I chose the bin/sh profile. I switched to my standard or original account for ssh and my profile loads appropriately.
I'm installing local gems again using my personal ssh to ~/webapps/<app> hoping this works out. I'm doing this because bundler requires > 1.3.6.
Is there a plan to upgrade the system gems by any chance?
We do not have any immediate plans to do so. You should be able to install gems as needed by following our documentation. If you are still having trouble, or have trouble in the future, feel free to open a support ticket and we will review your configuration.
In regards to your path variables, the line in your .bashrc file should be:
export PATH=$PATH:$HOME/.gem/ruby/1.8/bin
not:
PATH=$PATH:$HOME/.gem/ruby/1.8/bin