Dreamhost, DreamCompute(OpenStack) ssh login

Email this to someoneShare on Google+Share on FacebookTweet about this on TwitterShare on LinkedIn

Problem

You have just created your first instance in Dreamhost’s new service DreamCompute using OpenStack and you would like to login with ssh, but you get ‘Permission Denied’.

Solution

The solution is described here, and it’s the fact that the user name that you need to use is not your Dreamhost account name, or the DreamCompute dashboard user anme but the the username called:

NOTE: It seems that is also described here, at the bottom.

Dreamhost keeps asking for password when installing rvm ruby version

Email this to someoneShare on Google+Share on FacebookTweet about this on TwitterShare on LinkedIn

Problem

After installing rvm on dreamhost, when trying to install any ruby version afterwards, there is a prompt for password, and when entering the user’s password there is the message that the user is not in the sudoers list.

Solution

To be able to install the rvm ruby version you would like you should be installing them by using the following which is based on the answer here :

and then:

fatal: cannot exec ‘/tmp/…/git-ssh.sh’: Permission denied – Capistrano, Dreamhost, permission denied for git-ssh.sh

Email this to someoneShare on Google+Share on FacebookTweet about this on TwitterShare on LinkedIn

Problem

When trying to use the new Capistrano 3.x to set up your rails project in a dreamhost account, you get the following error complaining that the git-ssh.sh script copied to your account by capistrano cannot be executed as the permission is denied:

Solution

It seems that Dreamhost, and quite possibly other hosting providers are not allowing executables from the /tmp directory, which is where Capistrano places the git-ssh.sh script. So in order to be able to execute the script you can change the directory where the script is copied in the first place and put it in your home directory. You can do that by adding the following to the config/deploy.rb file:

Internal 500 server error – Dreamhost – Rails 3.0.3 – Capistrano

Email this to someoneShare on Google+Share on FacebookTweet about this on TwitterShare on LinkedIn

Problem
You want to deploy your Rails 3.0.3 in Dreamhost with capistrano, but even though you follow the steps from a previous post here, when you go to the application’s main page you still get an error:

500 Internal Server Error

Solution
Thanks to a blog post from Brendon Wilson here, the last missing piece from the puzzle in order to have your application running is to add the following line to the top of your deploy.rb file:

require 'bundler/capistrano'

and redo your cap deploy.

Thanks Brendon.

Rails 3 – Bundler – Dreamhost – Capistrano

Email this to someoneShare on Google+Share on FacebookTweet about this on TwitterShare on LinkedIn

Problem
You want to deploy your Rails (3.0.3) application to Dreamhost using Capistrano, but you get errors like:

bundle command not found
or
Enter your password to install the bundled RubyGems to your system:

Solution
You may be able to see in your deploy.rb file a commented section that says the following:

As Capistrano executes in a non-interactive mode and therefore doesn’t cause
any of your shell profile scripts to be run ….

So in order for capistrano to be able to find your bundle command you should add in your deploy.rb file a line with your paths (ie):

default_environment['PATH']='/usr/lib/ruby/gems/1.8/bin:/home/your_name/.gems/bin:/usr/local/bin:/usr/bin:/bin'

If you have the previous line your bundle command can run, but if you try to do cap:deploy your bundler will probably give you an error as it would ask for your sudo password. In order to avoid this error and to make it work you have to add another line with your gem path (ie):

default_environment['GEM_PATH']='/home/your_name/.gems:/usr/lib/ruby/gems/1.8'

making sure that your home directory path for your gems is first in the list.

capistrano deployment fails after dreamhost server move

Email this to someoneShare on Google+Share on FacebookTweet about this on TwitterShare on LinkedIn

Problem
You have set up your capistrano recipe for deployment to dreamhost using password less logins, but after dreamhost moves your git repository server to a different server, the deployment breaks, with ‘permission denied’ when trying to get the git repository.

Solution
As the server was moved you would need to copy your ssh public key from the deployment server to the new server again for the password-less logins to work again.
Follow the details here how to copy your public key across, login in once with your password, and after that your capistrano recipe should be working again as normal.

git and dreamhost : refusing to update checked out branch: refs/heads/master

Email this to someoneShare on Google+Share on FacebookTweet about this on TwitterShare on LinkedIn

Problem
After dreamhost decided to move my account that hosted the git repository to a new server, first time I’ve tried to push some changes to the git repository I was faced with the followng error:

Counting objects: 13, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (7/7), done.
Writing objects: 100% (7/7), 699 bytes, done.
Total 7 (delta 6), reused 0 (delta 0)
error: refusing to update checked out branch: refs/heads/master
error: By default, updating the current branch in a non-bare repository
error: is denied, because it will make the index and work tree inconsistent
error: with what you pushed, and will require 'git reset --hard' to match
error: the work tree to HEAD.
error:
error: You can set 'receive.denyCurrentBranch' configuration variable to
error: 'ignore' or 'warn' in the remote repository to allow pushing into
error: its current branch; however, this is not recommended unless you
error: arranged to update its work tree to match what you pushed in some
error: other way.
error:
error: To squelch this message and still keep the default behaviour, set
error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.
To ssh://dh_user@dh_domain/home/repository_path/projects/project.git

Solution
After searching and finding out various solutions to solve the problem, none of which was specific to a server move, I’ve tried the following:

  • Followed the steps here to set up a new repository project_asm.git
  • went to local project changed the config file to add the new remote repository
  • issued git push new_remote master
  • make a code change and then git push

And everything should work as normal again.

Deploying a Rails project in a server that hosts the git repository

Email this to someoneShare on Google+Share on FacebookTweet about this on TwitterShare on LinkedIn

Problem
You want to deploy your project in a server (dreamhost), that also hosts your git repository. When you try to do that by only setting the set_repository, you get errors like ‘permission denied, please try again’, even though if you try to checkout the git repository on your server works.

Solution
Set your :repository as a file in your host as in:
set :repository, "file:///home/username/git_on_server/projects/repo_name.git"

Then also set up your local_repository, as in:
set :local_repository, "user_name@server_domain_name:/home/username/git_on_server/projects/repo_name.git"

Rails Passenger Staging environment problem in Dreamhost

Email this to someoneShare on Google+Share on FacebookTweet about this on TwitterShare on LinkedIn

Problem
You want to deploy your rails application using Passenger in Dreamhost, but on a staging environment. It doesn’t work just changing your Capistrano recipe or your environment files, as the default environment for passenger is ‘production’.

Solution
Looking at the Passenger documentation here, there are four different ways of achieving that by changing the RailsEnv option. If you don’t want to change the Apache configuration files, and as long as the option AllowOverride is on (which should be on Dreamhost), then you would need to create an .htaccess file in your application’s public folder with the following:

RailsEnv staging

Dreamhost – SquirrelMail – old-messages folder

Email this to someoneShare on Google+Share on FacebookTweet about this on TwitterShare on LinkedIn

Problem
You have left a message in a squirrel mail account in dreamhost for a long time and it gets archived by dreamhost. According to the dreamhost you should be able to get to your archived messages, by looking at the old-messages folder.
The problem is that just by logging in to squirrel mail the folder doesn’t get displayed on the left hand side.

Solution
Log on to squirrel mail and go to ‘Folders’ menu at the top.
In the ‘Create Folder’ put ‘test’ or anything that you would like in the text box, and make sure that in the dropdown box you select ‘INBOX.old-messages’, so your newly created folder is a subfolder of the ‘inbox/old-messages’ folder.
Create the subfolder, refresh the page, and in your left hand the old-messages folder should appear.