Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Oh My Science
Dec 29, 2008

Pardot posted:

You should buy somethingawful platinum so I can PM you and hook you up with beta access to things.

If I already have platinum can I have access to these beta things?

My Setup:

- RVM, ruby 1.9.3 (switching to rbenv eventually)
- Textmate
- iTerm2
- Heroku
- postgres
- git

Adbot
ADBOT LOVES YOU

hmm yes
Dec 2, 2000
College Slice
Anyone recommend a good OSX postgresql app for quickly browsing databases/tables? Sqlite has Base, and MySQL has Sequel Pro, but postgresql seems to have terrible tools. It's the only thing I miss (although because we deploy so much to Heroku I would never switch back).

hmm yes fucked around with this message at 00:03 on Feb 28, 2012

Pardot
Jul 25, 2001




atastypie posted:

Anyone recommend a good OSX postgresql app for quickly browsing databases/tables? Sqlite has Base, and MySQL has Sequel Pro, but postgresql seems to have terrible tools. It's the only thing I miss (although because we deploy so much to Heroku I would never switch back).

There weren't any good ones, so we're working on one. I can maybe get you an alpha copy if you'd like.

Pardot fucked around with this message at 22:17 on Dec 8, 2013

prom candy
Dec 16, 2005

Only I may dance
Do you guys use postgre in production as well or just for development?

Doc Hawkins
Jun 15, 2010

Dashing? But I'm not even moving!


prom candy posted:

Do you guys use postgre in production as well or just for development?

When people say "use postgres in development," it's short for "use exactly the same environment in development as in production, by the way use postgres."

Pardot
Jul 25, 2001




While we're all talking about postgres, shameless self promotion: redacted

Pardot fucked around with this message at 22:17 on Dec 8, 2013

prom candy
Dec 16, 2005

Only I may dance

Doc Hawkins posted:

When people say "use postgres in development," it's short for "use exactly the same environment in development as in production, by the way use postgres."

Do you mind giving me a quick rundown of why it's better than MySQL, or pointing me towards some info about it? MySQL has always just worked for me so I've never really given other solutions much thought.

Pardot
Jul 25, 2001




prom candy posted:

Do you mind giving me a quick rundown of why it's better than MySQL, or pointing me towards some info about it? MySQL has always just worked for me so I've never really given other solutions much thought.

http://www.quora.com/Heroku/What-were-the-reasons-for-Heroku-choosing-PostgreSQL-over-MySQL

enki42
Jun 11, 2001
#ATMLIVESMATTER

Put this Nazi-lover on ignore immediately!
I'm shocked that there aren't more people using Sublime Text 2 in here. It's honestly the best parts of every text editor rolled into one super-amazing program. Plus you can get it for every platform. And the dude who makes it is insane and adds features like every night.

Rest of our setup:
- DB: Postgres
- DB editor: pgAdmin (ugh!)
- Text Editor: Sublime text 2
- Server: unicorn / thin
- Gem management: RVM (I really don't get the rbenv fuss, RVM might be coded wonky but it works just fine. I guess if you really like aliasing bundle exec all over the place..)
- Foreman
- Git command line / GitHub for Mac for occasionally checking out some random project.
- Git flow for branching / etc (with the exception that we don't git flow feature finish and use GitHub pull requests instead).

Also, I like cool heroku beta access stuff too :)

tima
Mar 1, 2001

No longer a newbie
I use screen, rvm, vim with rails plugins, git and heroku.

I ve used both mate and subliminal but I work from multiple platforms and being able to ssh and work from anywhere is worth it.

I'd also like access to heroku beta apps if possible.

8ender
Sep 24, 2003

clown is watching you sleep
rvm
pow
zsh / terminal.app
netbeans :sweatdrop:

kalleth
Jan 28, 2006

C'mon, just give it a shot
Fun Shoe
Just throwing this out there...

Am I the only one who doesn't like using the generators and just writes the migration and class by hand? It's not hard, self.up, self.down, blank Model < ActiveRecord::Base, etc.

It's not that I don't trust generators, i'd just rather learn how to code the stuff a generator does for me, and it doesn't even save that much time :(

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

kalleth posted:

Just throwing this out there...

Am I the only one who doesn't like using the generators and just writes the migration and class by hand? It's not hard, self.up, self.down, blank Model < ActiveRecord::Base, etc.

It's not that I don't trust generators, i'd just rather learn how to code the stuff a generator does for me, and it doesn't even save that much time :(

The way migrations get written change somewhat often (self.change), and honestly I don't care how they're written, just that they are. Letting the computer do it is one less place I can gently caress it up.

prom candy
Dec 16, 2005

Only I may dance
I let the generator do it for me, especially because you've been able to write the whole thing from the command line for a few years now.

Smol
Jun 1, 2011

Stat rosa pristina nomine, nomina nuda tenemus.
Speaking of migrations, is there a good way to add auto-incrementing (non-id) columns (like, say serial in Postgres) with the Ruby DSL? It's possible to add one by writing the SQL manually, of course, but those don't get added to schema.rb automatically, so it's kind of a pain in the rear end to work with.

prom candy
Dec 16, 2005

Only I may dance
Wow I am loving Sublime Text 2. Thanks for the recommendation!

Edit: Seriously, how the gently caress is it this fast? If you're a TextMate user you have to give this a try.

prom candy fucked around with this message at 04:05 on Feb 29, 2012

Physical
Sep 26, 2007

by T. Finninho

prom candy posted:

Wow I am loving Sublime Text 2. Thanks for the recommendation!
You just made me check it out. Thanks for that. I recently got a plugin for visual studio that does the "view from 10,000 feet" and it's so great. It helps you get a spatial bearing on documents that all look the same inside the scrollbar.

Scaramouche
Mar 26, 2001

SPACE FACE! SPACE FACE!

This might be a dumb question, but I've a client who has a specced out project they've approached us with. It's bizarrely specific in some cases (e.g. 'use Ruby on Rails on Cake PHP on Gentoo Linux') and opaque in others ('database: don't use Oracle') and contradictory in yet others ('check for aspx errors' on php?). One of their criteria calls for an audit phase that involves unit testing; the impression I'd gotten is that the dynamism of Ruby pretty well means you can't easily do this. Am I wrong?

Doc Hawkins
Jun 15, 2010

Dashing? But I'm not even moving!


I think you are. Unit testing seems relatively popular in Ruby development. Ruby has two unit testing frameworks built into the standard library (well, one and a half), and there's a handful of others that people use. All you have to do as far as dynamism is test behaviors rather than identities: expect a returned object to respond to some methods, rather than have the class MethodResponder or whatever.

Also, tell me isn't a real example:

quote:

use Ruby on Rails on Cake PHP on Gentoo Linux

Splinter
Jul 4, 2003
Cowabunga!
Thanks for all the OSX setups. I'm trying out Sublime now too.

Question: I'm building my first rails app with the goal of both learning rails (and web development in general) and hopefully eventually releasing something that people will use (lots of people :v: ). I was planning on using SQLite, but after seeing that many people here are using postgres, I'm wondering if should I use postgres from the get go. I'm under the impression that SQLite isn't suited for significant traffic in production for an app that can be write intensive, since the entire DB is locked on each write. If there's a chance I'll have to migrate to Postgres on production, should I just start development with Postgres, or should I start with SQLite and worry about migration when performance actually becomes a problem?

Doc Hawkins
Jun 15, 2010

Dashing? But I'm not even moving!


Doc Hawkins posted:

"use exactly the same environment in development as in production, by the way use postgres."

Physical
Sep 26, 2007

by T. Finninho

Doc Hawkins posted:

I think you are. Unit testing seems relatively popular in Ruby development. Ruby has two unit testing frameworks built into the standard library (well, one and a half), and there's a handful of others that people use. All you have to do as far as dynamism is test behaviors rather than identities: expect a returned object to respond to some methods, rather than have the class MethodResponder or whatever.

Also, tell me isn't a real example:
Sounds like that guy has a pain in the rear end client.

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

Splinter posted:

Thanks for all the OSX setups. I'm trying out Sublime now too.

Question: I'm building my first rails app with the goal of both learning rails (and web development in general) and hopefully eventually releasing something that people will use (lots of people :v: ). I was planning on using SQLite, but after seeing that many people here are using postgres, I'm wondering if should I use postgres from the get go. I'm under the impression that SQLite isn't suited for significant traffic in production for an app that can be write intensive, since the entire DB is locked on each write. If there's a chance I'll have to migrate to Postgres on production, should I just start development with Postgres, or should I start with SQLite and worry about migration when performance actually becomes a problem?
Develop with whatever you want, deploy on Heroku which uses Postgres. If you develop on Postgres you know you'll be making a Postgres-compatible app.

Scaramouche
Mar 26, 2001

SPACE FACE! SPACE FACE!

Doc Hawkins posted:

I think you are. Unit testing seems relatively popular in Ruby development. Ruby has two unit testing frameworks built into the standard library (well, one and a half), and there's a handful of others that people use. All you have to do as far as dynamism is test behaviors rather than identities: expect a returned object to respond to some methods, rather than have the class MethodResponder or whatever.

Also, tell me isn't a real example:

Thanks for the info. My testing background thus far has been as you've said, more about the Class style response. This makes sense for Ruby, though it feels less exhaustive.

Also that example is as real as the day is long. I don't 'own' this client, they approached us and we're still considering taking them on. I'm not quite sure what direction this will take but will after the initial proto-meeting tomorrow.

prom candy
Dec 16, 2005

Only I may dance

Scaramouche posted:

Also that example is as real as the day is long.

Make sure you update the thread when you inevitably post the story on Clients From Hell.

8ender
Sep 24, 2003

clown is watching you sleep
Also throwing out a thank for Sublime Text. Its fantastic. I have a few plugins installed now and its feeling pretty great.

enki42
Jun 11, 2001
#ATMLIVESMATTER

Put this Nazi-lover on ignore immediately!
For those just getting into Sublime text, here's a few tips that turned it from :aaa: to :aaaaa:

  • Command-P (or Ctrl-P on win / linux) is way more powerful than you think. After you've located a file you want, hit ":" to jump to a particular line number in that file or "@" to find a method by its name (works fine for ruby, haven't tried in much else).
  • Command-Shift-P can run pretty much every command that Sublime text is capable of. Just hit it and type what you want to do. I use this all the time with the Git plugin to see a list of changed files, add commits, etc. without needing to leave sublime text.
  • Command-Ctrl-P switches projects (take a few minutes to set up projects, they're awesome.) The amazing thing is you can leave one project and switch to another, and when you switch back, all your unsaved files, open files, etc. are still there and your cursor is even in the same place)
  • Hit Cmd and click in a bunch of places to make multiple selections. This is great when you need to modify the same thing in a bunch of different places
  • If you're in a find dialog, and you need to rename 20 instances of a variable, find it, hit Alt-Enter, now every instance of the variable is selected and you can edit them at the same time.

A MIRACLE
Sep 17, 2007

All right. It's Saturday night; I have no date, a two-liter bottle of Shasta and my all-Rush mix-tape... Let's rock.

Sublime's cool, it also has a vi editor mode, was in a recent patch. You just hit esc and you're in vi mode. You have to enable it in the config first btw.

Physical
Sep 26, 2007

by T. Finninho

A MIRACLE posted:

Sublime's cool, it also has a vi editor mode, was in a recent patch. You just hit esc and you're in vi mode. You have to enable it in the config first btw.
Why is Vi worth using?

A MIRACLE
Sep 17, 2007

All right. It's Saturday night; I have no date, a two-liter bottle of Shasta and my all-Rush mix-tape... Let's rock.

Physical posted:

Why is Vi worth using?

Some people like it? I think they added that feature to ease the transition for old school VIM users coming to a GUI editor. I know I had to break the habit of typing :w every time I wanted to save when I got my job writing C# in Visual Studio.

Trabisnikof
Dec 24, 2005

Physical posted:

Why is Vi worth using?

Because if you know how to use it, it can be very powerful. Obviously no longer the easiest system to learn, but why re-invent the wheel for those of us who already know how to do complex things with it.

Cock Democracy
Jan 1, 2003

Now that is the finest piece of chilean sea bass I have ever smelled

Trabisnikof posted:

Because if you know how to use it, it can be very powerful. Obviously no longer the easiest system to learn, but why re-invent the wheel for those of us who already know how to do complex things with it.
I recently forced myself to learn vim and use it regularly. I was using redcar previously but it's such a memory hog. I wanted a minimalist approach. vim is pretty slick for rails development (at least with this enabled). I'll give sublime a shot too if it's all the rage.

Scaramouche
Mar 26, 2001

SPACE FACE! SPACE FACE!

Physical posted:

Why is Vi worth using?

Because it makes emacs users hate you.

Fat Whale
Feb 20, 2012

O O O O O O O O O O
Ruby is cool.

Fat Whale fucked around with this message at 14:48 on Jun 19, 2012

8ender
Sep 24, 2003

clown is watching you sleep
Ruby isn't bad at all as a first programming language, really the problem is Rails. By problem I don't mean Rails is bad, its fantastic, but its also a lot to take on properly. Theres not just Rails but a host of other very modern concepts and technologies to take in at the same time. REST, migrations, OOP, etc all before you even get into actually using Rails.

I've been trying to put together a training regimen here at work for our PHP devs and its proving to be a pretty daunting thing. I'd actually recommend learning Ruby well first, then dipping your foot in the water with something like Sinatra before diving into Rails.

As easy as Rails looks its only easy on the surface. If you don't understand all of the technologies and concepts swirling around Rails you'll get yourself into trouble.

Smol
Jun 1, 2011

Stat rosa pristina nomine, nomina nuda tenemus.

Fat Whale posted:

This might not be the place to ask this but:

What do you guys think of Ruby as a first programming language for someone interested in web development as a hobby?

I really like the philosophy behind Ruby, and I like it's simplicity relative to other programming languages; however, I've heard people who say to stay away from it because it is too different from other languages that you're eventually gonna want to branch out and learn..

What's your background?

I think Ruby is a fine language for learning web development, but a language like Python might be easier to grasp by a total beginner. Much of the Ruby code you're going to see will use pretty advanced features to make it as elegant as it is, so you'll need a solid grasp of programming fundamentals to understand what's really going on. And if you're just starting to learn web development, I think it's better to start with the basics (What can I do with HTML, Javascript and CSS? How does AJAX work?) than with a full MVC framework like Rails.

Smol fucked around with this message at 07:12 on Mar 1, 2012

Fat Whale
Feb 20, 2012

O O O O O O O O O O
OK help me understand something:

Fat Whale fucked around with this message at 14:48 on Jun 19, 2012

Pardot
Jul 25, 2001




Ruby and Sinatra is better to start out with than Ruby and Rails. It's also better to end up at. Rails is good for the middle.

syntaxrigger
Jul 7, 2011

Actually you owe me 6! But who's countin?

To sort of piggy back off of Fat Whale's question, if I really wanted to learn a scripting language as well as web development, which is a better suggestion: Ruby or python? I am coming from a java background.

I keep going back and forth on this issue and I really have no idea how to solve the problem. My working solution right now is to learn both, starting with Ruby, and then make a decision.

My primary concerns are a path that will develop me into a better programmer and to be as marketable as possible.

syntaxrigger fucked around with this message at 19:10 on Mar 1, 2012

Adbot
ADBOT LOVES YOU

Physical
Sep 26, 2007

by T. Finninho
Hey guys have any of you used inherited resources?

This project at work is giving me a fit.

I hooked up a connection to a user from an IT_device.

code:
class ItDevice < Ititem
  belongs_to :account
  belongs_to :owner, :class_name => "User", :foreign_key => "owner"
end

class User < ActiveRecord::Base
  has_many :it_devices
end
The I get this error. Notice the line "owner"=>"1"

WTF does this mean? Why won't it accept an integer via this edit method?

code:
ActiveRecord::AssociationTypeMismatch in Administration::ItDevicesController#create
User(#107149644) expected, got String(#15430848)
Rails.root: C:/Sites/WorkProject
Application Trace | Framework Trace | Full Trace
Request
Parameters:
{"utf8"=>"&#10003;",
"authenticity_token"=>"FDSoQpWG9ariHJa12Ujt+B9A+pm7R+jrSvDpEerQMHs=",
"it_device"=>{"title"=>"",
"description"=>"",
"additional_information"=>"",
"owner"=>"1",
"ip"=>"",
"role"=>"Please Pick a Role",
"location_id"=>"Please Pick a Location"},
"commit"=>"Create Device",
"a"=>{"{:value=>\"a\"}"=>""}}

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply