On the web – sort of

September 14, 2007

My app’s up but not quite running. I’m getting this when i go to the beta url (which is http://beta.reeplies.com/public) :

Application error

Rails application failed to start properly”

Yesterday, Jay Gooby from the Brighton Ruby group kindly gave me several hours of his time to try and get Reeplies up and running. Here’s a breakdown of what i’ve done so far, before meeting Jay and with his help, as much for my own benefit as anyone elses.

Got my account with bluehost, which included free domain name registration with a years’ hosting (which cost about £45).

Got them to give me SSH access (i needed to provide some id, i emailed photos of the front and back of my driving license which was fine). They provided me with an ssh login and password. I learned that SSH is basically like telnet – a way of communicating with a remote host via the command line The difference is that the communication is encrypted, but that all happens under the hood – from a users perspective it’s like telnet.

Using the bluehost control panel, added an ftp account “max_williams@reeplies.com”. This created a subfolder called /public_html/max_williams.

Jay added another ftp account “beta@reeplies.com” which has the folder /rails/beta. This folder is to hold my working rails application folder.

Next step was to copy the application folder over! Bluehost provide their own ftp client for this but it’s a java applet and is a bit clunky. We used CoreFTP which i had already installed. We logged into beta@reeplies.com, and then just dragged the ‘newspipe’ (the working name of Reeplies) folder into the root directory (ie into rails/beta).

We were doing this using the wifi in the Windmill on montpelier terrace (nice pub btw – well kept ale and great chips) so the upload took a long time. Tip for anyone doing this – copy your app folder over to a temporary location and clear out anything you don’t need – saved files from the public folder and svn files for example. Then upload the cleaned up copy instead of your original folder. Obviously the PROPER way to do it is to get an online svn repository and install it from there. I’m working on it, for now the priority is to get SOMETHING up there.

Anyway, next step is to deal with Ruby gems and plugins: the host doesn’t have the ones i use, so i need to install them myself. According to Jay this is simple – we just go into the host unix environment (using ssh) and treat it like we would our own local command line. One difference is that the host is a unix environment whereas i’m used to windows: that means that some or all of the plugins/gems will use different versions to the ones i used.

To connect to the ssh command line i used PuTTY, with these connection settings:

Host name = reeplies.com
port = 22
connection type = SSH

(putty lets you save these details for future use)

So, now we’re on the remote server’s command line! Time for me to do a little bit of research into unix commands – i’ve never really ‘done’ unix. OK…

cd dirname – open directory – same as windows.
cd .. – go up – again same as windows
ls – list files and folders – like dir in windows

ok…

Next step was to get a mysql database up for my app to use. Created this using the bluehost control panel – a new mysql database called ‘reeplies_newspipedevelopment’ (it wouldn’t let us put underscores in for some weird reason, even though it adds the “reeplies_” prefix itself. Then, after the database.yml file had copied over, Jay changed it to point to the new database, and also set it so that it won’t be overwritten when i copy my files over.

I’m *not sure* whether we actually managed to set the database up, ie create all the tables and fields using my schema. There was an issue with rake – it didn’t seem to want to work. I think that this was maybe just because the files were still copying over the ftp. I just tried it now, but it’s having a problem because hpricot isn’t installed. hpricot is one of my gems (or is it a plugin?), so i guess all the gems and plugins need to be there before the migrate can happen.

Hmm. Think i’ll try commenting out those lines from environment.rb for now to see if i can get the migration to work…nope, now it has a permissions issue:

Access denied for user ‘max’@’localhost’ (using password: YES)
I’m a bit nervous about flailing around with this in case i break something. Think i’ll leave it till i get my next expert help session tomorrow from James McCarthy.

So, might as well get on with installing the gems and plugins! According to my environment.rb file, this is what i’m using (in future it would be a good idea to put in a comment next to them with the precise command i used to install them):

require ‘rubygems’
require ‘RMagick’
require ‘open-uri’
require ‘hpricot’ – used to get the title of a web page from a url
include Magick
gem ‘actionpack-imagemagick’
require “mini_magick”

Now, i remember reading about a ruby gem that basically takes all of your gems, and maybe plugins, that you’re using and does something with them that makes them easy to copy over. Looks like this is it – Rick Olsen’s Tzinfo: http://agilewebdevelopment.com/plugins/gems

Looks a bit complex – or rather, i’m nervous :) Going to try installing them one by one. Let’s do hpricot first as i think that was pretty simple (unlike rmagick/imagemagick).

hpricot: seems simple enough – just type

gem install hpricot

Gah, foiled again: i get a choice of versions (windows, jruby, ruby) and when i choose ruby i get:

ERROR: While executing gem … (Errno::EACCES)
Permission denied – /usr/lib/ruby/gems/1.8/cache/hpricot-0.6.gem

OK – time to mail the bluehost people i think…

OK – before i post my question, they suggest some previous replies that may be helpful. One of them is “How do I install my own Gems?”. Let’s have a look.

OK – according to this, i do the following: use their file manager to open .bashrc, which is in the root directory (back it up first). Then add the following lines to the end:

export PATH=”$PATH:$HOME/packages/bin:$HOME/.gems/bin”
export GEM_HOME=”$HOME/.gems”
export GEM_PATH=”$GEM_HOME:/usr/lib/ruby/gems/1.8″

export GEM_CACHE=”$GEM_HOME/cache”

Then connect to the site with ssh (i’m in there already), and enter the following in the root folder:

cp /usr/lib/ruby/gems/1.8/cache/sources-0.0.1.gem ./
gem install sources-0.0.1.gem
gem update -y

Did the first line, got a permission denied error again. OK, i’m mailing them now! Arggh, they’ve got no option to edit your ‘ticket’ ie your help request – it’s either send it or cancel it and start again! That’s really annoying. Going to have to rewrite it as i want to tell them that this other suggestion doesn’t work.

22 Responses to “On the web – sort of”

  1. Lily Says:

    I tend not to create a comment, but after looking at through a few of
    the responses on On the web – sort of nuby on rails.
    I actually do have a couple of questions for you
    if you tend not to mind. Is it simply me or does it look like like some of these remarks appear as if they are
    coming from brain dead visitors? :-P And, if you are writing
    on other online sites, I’d like to follow you. Could you make a list of every one of your shared pages like your twitter feed, Facebook page or linkedin profile?

  2. Max Williams Says:

    Hi Lily – yeah a lot of my comments are just spam. This blog is pretty much abandoned to be honest, which is a shame. I’m still doing rails dev for my job but never seem to have time to blog about it. If you want to follow me on twitter i’m @toastkid

    cheers for reading :)

  3. Rudolf Says:

    I just dropped by to view this blog. It appears really superb and I had a good time browsing
    it, thank you very much for the helpful stuff!

  4. Dewitt Says:

    I recognize beneficial information, this really is a very good piece of writing.
    I’m going to check it even more later on and send it along to a few of my close friends that might be interested

  5. Teri Says:

    With having so much content do you ever run into any problems of plagiarism or copyright violation?
    My website has a lot of exclusive content I’ve either authored myself or outsourced but it looks like a lot of it is popping it up all over the web without my authorization. Do you know any solutions to help protect against content from being stolen? I’d truly appreciate it.

  6. still Says:

    I leave a leave a response when I appreciate a article on
    a site or I have something to valuable to contribute to the discussion.
    Usually it’s a result of the fire displayed in the post I looked at. And after this post On the web – sort of | nuby on rails. I was excited enough to drop a comment :) I do have some questions for you if you tend not to mind. Is it simply me or does it look like like some of the remarks look like they are left by brain dead folks? :-P And, if you are posting on other places, I would like to keep up with everything fresh you have to post. Could you list every one of your shared sites like your linkedin profile, Facebook page or twitter feed?


  7. anyone obviously… dont you know diamonds are a girl’s companion?


  8. Hi there, i read your blog occasionally and i own a similar one and i
    was just wondering if you get a lot of spam remarks? If so how
    do you prevent it, any plugin or anything you can advise?

    I get so much lately it’s driving me crazy so any support is very
    much appreciated.


  9. Thank you foor sharing your thoughts. I really appreciate your efforts and I will be waiting for your further write ups thanks once
    again.


  10. Thanks for finally writing about >On the wweb – sort
    of | nuby on rails <Liked it!


  11. Hi there, I found your website by way of Google whilst looking for a related matter, your web site came up,
    it appears to be like good. I’ve bookmarked it in my google bookmarks.

    Hello there, simply changed into alert to your weblog via Google, and found that it’s really informative.
    I am going to be careful for brussels. I will be grateful if
    you proceed this in future. Numerous folks will probably be benefited
    out of your writing. Cheers!


  12. I really like your blog.. very nice colors & theme. Did you
    design this website yourself or did you hire someone to do it for you?
    Plz respond as I’m looking to design my own blog and would like to
    find out where u got this from. cheers


  13. The 43-year old Canadian heavy metal monster and Axl sycophant,
    who “don’t live crazy like I used to” but still enjoys a glass of red wine on an evening, revealed in
    an interview how he believes Axl is “one of a kind” and has that same “kind of danger thing going on” as Jim Morrison when he “steps up to the mic. The coral reefs are living organisms that become sick when subjected to various chronic stressors on their environment. The markings from his body still showed but without his original soul they were just markings.


  14. I just like the valuable info you supply to your
    articles. I will bookmark your blog and check again right here frequently.
    I am reasonably sure I will be informed lots of new stuff right here!
    Best of luck for the next!


  15. Howdy! This article could not be written much better!

    Going through this article reminds me of my previous roommate!
    He constantly kept preaching about this. I most
    certainly will send this information to him. Fairly certain he will have a great read.

    I appreciate you for sharing!


  16. I like the helpful information you provide in your articles.
    I’ll bookmark your blog and check again here frequently. I’m quite certain I’ll learn a
    lot of new stuff right here! Good luck for the next!


  17. Everything is very open with a clear explanation of the challenges.
    It was definitely informative. Your site is useful.
    Thanks for sharing!


  18. Hey there I am so excited I found your website, I
    really found you by error, while I was searching on Aol for something else, Anyhow
    I am here now and would just like to say thanks for a tremendous post
    and a all round entertaining blog (I also love the theme/design),
    I don’t have time to look over it all at the moment but I have
    bookmarked it and also included your RSS feeds, so when I have time
    I will be back to read a lot more, Please do keep up the superb jo.


  19. Lady Windsor, presently living in Africa but however
    dying of cancer has a number of billion that she does
    not want her family to get their hands on, so she wants me to give it to
    her cats, and THE director general of the Nigerian National
    bank is in the unfortunate position of possessing to ‘dispose’ of many billion that was left in an account
    by a presumed dead terrorist.


  20. Hi would you mind letting me knoѡ which web host ʏou’re
    using? I’ve loaded yοur blog in 3 different web browsers аnd I must say
    this blog loads a lߋt faster then most. Can you ѕuggest a
    ǥood internet hosting provider аt a honest price? Thanks а lot, I аppreciate it!


  21. Hello woսld you mind letting me know which webhost you’re using?
    I’ve loadеd your blog іn 3 different wᥱb browsers and I must say thіs blog loads a lot faѕter
    then most. Can you suggest a good web hosting provider at a rеasonable price?
    Cheers, I apρreciate it!


  22. Great information. Lucky me I discovered your blog by accident
    (stumbleupon). I have book-marked it for later!


Leave a reply to Krikorian Helena Cancel reply