1

I have an app written with Ruby 1.9.3 with Rails 3.2.6. After the fact I'm deploying on Bluehost, no choice here, who has Ruby 1.8.7 on the server.

I'm getting the different time format error on my gems. I can edit them on the server but next time I do a cap deploy I'm going to wipe the changes and have to do it again. BH let me upgrade Rails to 3.2.6 from the command line but I can't upgrade to Ruby 1.9.

  1. Can I upgrade the server or am I going to have to rewrite my app with Ruby 1.8?
  2. If I do rewrite will I have to do it again when they upgrade all of their servers to 1.9?

I have called and done live chat with BH and they always send me to the set up page for new apps.

Naftali
  • 144,921
  • 39
  • 244
  • 303
jasonw
  • 122
  • 6
  • You should look into installing RVM locally (if you haven't already) - that will let you test on Ruby 1.8.7. Rails 3.2.8 works with that older version of Ruby so you'll probably find changes to your app are minimal, and if BlueHost only support 1.8.7, that's what you're going to have to use. All that said, if you're serious about using Rails for a production app, look at other slightly more expensive hosts, see this thread for example: http://railsforum.com/viewtopic.php?id=42815 – Kenny Grant Sep 28 '12 at 15:09
  • I took the approach of installing RVM and it worked very nicely. The only catch is that, when you install rvn, make sure to include the `--ruby` and `--rails` arguements (so your command is: `curl -L https://get.rvm.io | bash -s stable --ruby --rails`). I tried the first time without `--rails` and had some trouble getting rails to install separately. I eventually gave up, wiped out `~/.rvm` and started over, this time passing it the `--rails` arg – Isaac Betesh Oct 16 '12 at 05:11

2 Answers2

1

First of all, if the App runs on 1.8.7 it will (most likely) run on 1.9.x aswell.

The other way around is a bit harder... Rails 3.2.x is the last Version of RoR to support Ruby 1.8.7. But unless you used --old-style-hash when creating, you'll have quite some work to do.

Depending on how complex your code is, it may be enough to fix all hashes:

# Ruby 1.9:
hsh = { foo: "bar" }

# Ruby 1.8 and 1.9:
hsh = { :foo => "bar" }
mhutter
  • 2,800
  • 22
  • 30
  • Thank Dratir. That is where my head is. Thanks for the validation. The app is still small so I'll fix the hashes. – jasonw Sep 28 '12 at 14:08
0

You must rewrite your app to Ruby 1.8. Most shared web hosts do not use Ruby 1.9 yet, or I haven't found one at least. So you must develop to the specifications of the server you're deploying to. Most shared web hosts have no clue how to deal with Ruby; PHP and Perl, and the like, have been around a long time in the server environment and are well understood—but Ruby is still somewhat new.

Or, you could find a better/VPS host. I've eyed prgmr.com as a budget way to learn managing a VPS environment (I'm not affiliated with them), but I have a VPS on Linode I don't need their services.

Robert K
  • 30,064
  • 12
  • 61
  • 79