Ruby on Rails

Connect with other users about what to run on your webhosting (and how to run it) here.
Post Reply
Moggle
New to forums
New to forums
Posts: 7
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Tue Sep 20, 2011 7:01 pm

Ruby on Rails

Post by Moggle »

Hey, just a question about deploying Ruby on Rails apps.

Apparently you use mod_rails for RoR support. This seems great, except that it appears that I need to edit the httpd.conf file in order to add apps, and given that this is shared webhosting, something tells me that's probably not the best idea. Heck, I don't even know if I can overwrite it (and I'm sure as hell not going to try).

Is there an easier way? The RoR app is at public/wod/railtest/ on slynet (thegoodsirs.net/slynet.co). I also uploaded it to rail_apps/railtest.
User avatar
Edge100x
Founder
Founder
Posts: 12945
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: Ruby on Rails

Post by Edge100x »

Passenger automatically detects RoR applications and you don't need to edit the http.conf file for this. Just upload your application and give it its own vhost, and you should be set.

If you don't want to give it its own vhost, you should be able to change RailsBaseURI through .htaccess, though I haven't experimented with this: http://www.modrails.com/documentation/U ... ilsBaseURI

We talk about setting up a sample RoR application here: http://www.nfoservers.com/forums/viewto ... =19&t=3994
Moggle
New to forums
New to forums
Posts: 7
Joined: Tue Sep 20, 2011 7:01 pm

Re: Ruby on Rails

Post by Moggle »

Thank you very much!
Moggle
New to forums
New to forums
Posts: 7
Joined: Tue Sep 20, 2011 7:01 pm

Re: Ruby on Rails

Post by Moggle »

Hate to double post, but there seems to be a problem with using databases.

Code: Select all

slynet@hosted3 ~ $ cd ror_apps/charsheets
slynet@hosted3 ~/ror_apps/charsheets $ rake db:create:all
(in /usr/www/slynet/ror_apps/charsheets)
rake aborted!
no such file to load -- sqlite3
slynet@hosted3 ~/ror_apps/charsheets $ gem install sqlite3
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions into the /usr/lib64/ruby/gems/1.8 directory.
At this point, I tried setting up a database and changing my config file to use mysql.

Code: Select all

slynet@hosted3 ~/ror_apps/charsheets $ rake db:create:all
(in /usr/www/slynet/ror_apps/charsheets)
!!! The bundled mysql.rb driver has been removed from Rails 2.2. Please install the mysql gem and try again: gem install mysql.
rake aborted!
no such file to load -- mysql

(See full trace by running task with --trace)
slynet@hosted3 ~/ror_apps/charsheets $ gem install mysql
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions into the /usr/lib64/ruby/gems/1.8 directory.
I don't suppose I'm just doing things really stupidly? Bundling gems is sort of going to be difficult because I'm on a Windows box and the server is on Linux, and installing gems seems to be out of the question.

Do you know if there's anyone using your webhosting who actually has a full out working RoR app I can talk to? Hate bothering you with my idiotic questions.
Moggle
New to forums
New to forums
Posts: 7
Joined: Tue Sep 20, 2011 7:01 pm

Re: Ruby on Rails

Post by Moggle »

Alright, so from what I've found out:

There's a .gem folder for each user. Which is great. I can use gem install mysql --install-dir /usr/www/slynet/.gem/ruby/1.8 with no problem!

The issue is that rake apparently won't check that folder for the gem.

Sorry for a triplepost, the edit button is currently on hiatus, apparently. I remember reading you temp disabled it to prevent abuse or something, but I forget.
Moggle
New to forums
New to forums
Posts: 7
Joined: Tue Sep 20, 2011 7:01 pm

Re: Ruby on Rails

Post by Moggle »

Alright, the edit button disappearing after like 2 minutes is very annoying.

ANYWAYS, the solution I posted worked. I just made a huge booboo because I'm an idiot!

If you want a gem, you have to install it to your local dir. Use:

Code: Select all

gem install mysql --install-dir ~/.gem/ruby/1.8
and things should start working.
User avatar
Edge100x
Founder
Founder
Posts: 12945
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: Ruby on Rails

Post by Edge100x »

I'm glad you were able to get it working :).

(If phpBB had an option to prevent editing only after a post has been viewed, I would use that instead of a time limit. There may be a plugin for it, but I haven't had time to look around for one or to test one if I did find one.)
Post Reply