Author Topic: Ruby on Rails  (Read 7399 times)

Steve

  • This 49%er supports Romney
  • Just a Jackass
  • *
  • Posts: 16120
  • Karma: +31/-410
  • Mr. Mom
Ruby on Rails
« on: October 22, 2008, 11:09:20 AM »
anyone use this? I'm creating a website that, wthout too much detail, is mainly one big database with new entries coming and being presented constantly. I know of a website that did something sorta kinda similar on a slightly different and much much smaller scale and they designed it with Ruby on Rails.

I have never used RoR and i dont know much about it. I just know its supposedly easier and makes projects go 10x as fast.
hey ethic if you and i were both courting lily allen..... oh wait, which one of us has a relationship that lasted more than the bus ride home?

hans

  • Guitar Addict
  • Jackass In Charge
  • Posts: 3523
  • Karma: +46/-18
Re: Ruby on Rails
« Reply #1 on: October 22, 2008, 11:13:40 AM »
I used it briefly, but we use Grails (the Java equivalent) since we're a Java shop. It makes development very quick. The advantage of Rails is that more hosts are starting to support it, so it works well with the LAMP providers.

It's pretty easy to pickup and there's quite a bit of help out there.
This signature intentionally left blank.

Steve

  • This 49%er supports Romney
  • Just a Jackass
  • *
  • Posts: 16120
  • Karma: +31/-410
  • Mr. Mom
Re: Ruby on Rails
« Reply #2 on: October 22, 2008, 11:18:32 AM »
I'm installing it all to ubuntu now with a guide. I'm going to try and find as much data to compile onto the laptop today, since i wont have net access after tonight but ill need to be working on it.
hey ethic if you and i were both courting lily allen..... oh wait, which one of us has a relationship that lasted more than the bus ride home?

ober

  • Ashton Shagger
  • Ass Wipe
  • Posts: 14309
  • Karma: +73/-790
  • mini-ober is taking over
    • Windy Hill Web Solutions
Re: Ruby on Rails
« Reply #3 on: October 22, 2008, 11:54:15 AM »
Never used it but I hear fairly good things about it.  Since you already know some PHP, it might be more beneficial to learn a PHP framework like Zend that would speed your development time.

Steve

  • This 49%er supports Romney
  • Just a Jackass
  • *
  • Posts: 16120
  • Karma: +31/-410
  • Mr. Mom
Re: Ruby on Rails
« Reply #4 on: October 22, 2008, 11:57:41 AM »
Never heard of it. Man dont tell me i have been writing all this php from scratch for nothing :rofl2:

I downloaded a shitload of RoR ebooks and even archived a bunch of online walktrhoughs, intros, etc. Trying to whore all the resources i can. The power allowing me to do all this isnt exactly.....well it just not.
hey ethic if you and i were both courting lily allen..... oh wait, which one of us has a relationship that lasted more than the bus ride home?

Steve

  • This 49%er supports Romney
  • Just a Jackass
  • *
  • Posts: 16120
  • Karma: +31/-410
  • Mr. Mom
Re: Ruby on Rails
« Reply #5 on: October 22, 2008, 02:19:12 PM »
I'm following along with Agile Web Development with Rails and so far, it has me excited. RoR seems to have alot of potential. Not only will is, im assuming, make this project alot easier and solid, but will save me worlds of time in the future on other projects.
hey ethic if you and i were both courting lily allen..... oh wait, which one of us has a relationship that lasted more than the bus ride home?

Steve

  • This 49%er supports Romney
  • Just a Jackass
  • *
  • Posts: 16120
  • Karma: +31/-410
  • Mr. Mom
Re: Ruby on Rails
« Reply #6 on: October 22, 2008, 02:47:08 PM »
Anyone know how to install RadRails on Ubuntu without going through the long drawn out like 80 steps? You need to install studio, then install something else, then install this wtf man.
hey ethic if you and i were both courting lily allen..... oh wait, which one of us has a relationship that lasted more than the bus ride home?

Dumah

  • Jackass IV
  • Posts: 960
  • Karma: +21/-6
Re: Ruby on Rails
« Reply #7 on: October 22, 2008, 04:31:27 PM »
Dunno. I use Python & Django

Steve

  • This 49%er supports Romney
  • Just a Jackass
  • *
  • Posts: 16120
  • Karma: +31/-410
  • Mr. Mom
Re: Ruby on Rails
« Reply #8 on: October 22, 2008, 04:34:12 PM »
I'm using Cream right now, but after i get done these examples and i start the actual project i would like to use RadRails. I'll just do it the long way, fuck it.
hey ethic if you and i were both courting lily allen..... oh wait, which one of us has a relationship that lasted more than the bus ride home?

Steve

  • This 49%er supports Romney
  • Just a Jackass
  • *
  • Posts: 16120
  • Karma: +31/-410
  • Mr. Mom
Re: Ruby on Rails
« Reply #9 on: October 22, 2008, 05:06:09 PM »
Ok first error, and im not sure what the issue seems to be. Heres the error page (running a hello world test via the book im reading):

Quote
Mysql::Error in SayController#hello

Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

RAILS_ROOT: /home/steve/Desktop/test/demo
Application Trace | Framework Trace | Full Trace


Request

Parameters:

None

Show session dump

---
flash: !map:ActionController::Flash::FlashHash {}


Response

Headers:

{"cookie"=>[],
 "Cache-Control"=>"no-cache"}

The mysql server is running, i can see that from both the terminal and from the xampp status page. Also the demo application's database file has been modified to reflect mysql instead of sqllite. Not sure where the issue is...

Server Console (xampp):
Quote
steve@CM-Laptop:/$ sudo /opt/lampp/lampp start
[sudo] password for steve:
Starting XAMPP for Linux 1.6.8a...
XAMPP: XAMPP-Apache is already running.
XAMPP: XAMPP-MySQL is already running.
XAMPP: XAMPP-ProFTPD is already running.
XAMPP for Linux started.
steve@CM-Laptop:/$

Ruby Console (for project):

Quote
steve@CM-Laptop:~$ cd ~/Desktop/test/demo
steve@CM-Laptop:~/Desktop/test/demo$ ruby script/server
=> Booting Mongrel (use 'script/server webrick' to force WEBrick)
=> Rails 2.1.1 application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
** Starting Mongrel listening at 0.0.0.0:3000
** Starting Rails with development environment...
** Rails loaded.
** Loading any Rails specific GemPlugins
** Signals ready.  TERM => stop.  USR2 => restart.  INT => stop (no restart).
** Rails signals registered.  HUP => reload (without restart).  It might not work well.
** Mongrel 1.1.5 available at 0.0.0.0:3000
** Use CTRL-C to stop.

hey ethic if you and i were both courting lily allen..... oh wait, which one of us has a relationship that lasted more than the bus ride home?

webwhy

  • Jackass IV
  • Posts: 608
  • Karma: +15/-10
Re: Ruby on Rails
« Reply #10 on: October 22, 2008, 05:37:39 PM »
what's in database.yml?  why xammp?  it's extremely easy to setup lamp on ubuntu. the xammp mysql config might be setup in a slightly less "standard" way

hans

  • Guitar Addict
  • Jackass In Charge
  • Posts: 3523
  • Karma: +46/-18
Re: Ruby on Rails
« Reply #11 on: October 22, 2008, 05:58:39 PM »
Isn't there an embedded DB with Rails? Why not use that for your development?
This signature intentionally left blank.

Steve

  • This 49%er supports Romney
  • Just a Jackass
  • *
  • Posts: 16120
  • Karma: +31/-410
  • Mr. Mom
Re: Ruby on Rails
« Reply #12 on: October 22, 2008, 06:02:43 PM »
RoR uses SQLite out of the box, why install and use that when the project will use MySQL?

And i used Xampp because it was suggested, and it was a painless install with a nice control panel and security script.

database.yml (i have tried all kinds of different settings. User is correct, pw doesnt exist, host is localhost, and dbname, afaik, can be whatever i put there. I dont see anywhere in xampp to make one and it seems RoR creates it on the first launch....

Code: [Select]
# SQLite version 3.x
#   gem install sqlite3-ruby (not necessary on OS X Leopard)
development:
  adapter: mysql
  database: demo__development
  username: lampp
  password:
  host: localhost
  timeout: 5000

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
  adapter: mysql
  database: demo__development
  username: lampp
  password:
  host: localhost
  timeout: 5000

production:
  adapter: mysql
  database: demo__development
  username: lampp
  password:
  host: localhost
  timeout: 5000
hey ethic if you and i were both courting lily allen..... oh wait, which one of us has a relationship that lasted more than the bus ride home?

webwhy

  • Jackass IV
  • Posts: 608
  • Karma: +15/-10
Re: Ruby on Rails
« Reply #13 on: October 22, 2008, 09:29:10 PM »
Quote
RoR uses SQLite out of the box, why install and use that when the project will use MySQL?

if you're using migrations to build you database, which you should be using.  Rails is largely database independent. 

can you connect to mysql using the command line client?  look in you mysql.cnf to determine how xampp has setup mysql for tcp connections...is it bound to an ip...is skip-networking enabled?  this file should also tell you the location of the mysql unix socket for non tcp connections.  it might be in another location.  you can point rails to another socket location using the socket parameter in the yaml file.

development:
  adapter: mysql
  database: demo_development
  username: lampp
  password:
  socket:  /path/to/xampp/socket

what does netstat tell you?
Code: [Select]
$netstat --tcp --listening

is mysql listed in the output?


webwhy

  • Jackass IV
  • Posts: 608
  • Karma: +15/-10
Re: Ruby on Rails
« Reply #14 on: October 22, 2008, 09:35:42 PM »
also...you have to create the database..either through the mysql tools (mysql, mysqladmin) or through a rake task (ruby build tool).  The rake task doesn't work if the user rails uses to connect to the database doesn't have a the proper privileges...

Code: [Select]
mysqladmin -u lampp create demo_development
in the project folder
Code: [Select]
rake db:create