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
prom candy
Dec 16, 2005

Only I may dance
Devise has a configuration called :token_authenticatable that will let your users log in via API key.

Adbot
ADBOT LOVES YOU

Jam2
Jan 15, 2008

With Energy For Mayhem
What an acceptable amount of time for it to take to render a view in response to a request? Is 70ms too long in a development environment? As I haven't pushed anything to production, I cannot tell how careful I should be about performance and optimization in the initial development stage. (writing my first major application)

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.

Jam2 posted:

What an acceptable amount of time for it to take to render a view in response to a request? Is 70ms too long in a development environment? As I haven't pushed anything to production, I cannot tell how careful I should be about performance and optimization in the initial development stage. (writing my first major application)

Don't get into premature optimization. Once you deploy on production mode it'll be much faster anyway (because Rails won't have to knock down and reload your classes with every request).

Jam2
Jan 15, 2008

With Energy For Mayhem
What's the best way to make this readable and within 80 chars per line?

code:
      Listing.within(@region).includes(:region).where('category_id = ?', params[:category_id]).text_search(params[:query])

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.

Jam2 posted:

What's the best way to make this readable and within 80 chars per line?

code:
      Listing.within(@region)
             .includes(:region)
             .where('category_id = ?', params[:category_id])
             .text_search(params[:query])
I dunno, just personal preference really

prom candy
Dec 16, 2005

Only I may dance
Note that in 1.8 you would have to put the dots at the end of the lines rather than the beginning.

Can you do it like this? This is how I like to do it in Javascript but I don't know if it's valid Ruby.
code:
Listing
  .within(@region)
  .includes(:region)
  .where('category_id = ?', params[:category_id])
  .text_search(params[:query])

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.

prom candy posted:

Note that in 1.8 you would have to put the dots at the end of the lines rather than the beginning.

Can you do it like this? This is how I like to do it in Javascript but I don't know if it's valid Ruby.
code:
Listing
  .within(@region)
  .includes(:region)
  .where('category_id = ?', params[:category_id])
  .text_search(params[:query])

Pretty sure it's valid.

Nybble
Jun 28, 2008

praise chuck, raise heck
Is there a way in Github/Git to be notified when someone in your organization makes changes to a certain set of folders or files? My feet keep getting stepped on by another developer adding things without my knowledge and things end up breaking.

On a rails specific note, how can I check now or ensure that when I deploy, it gets marked as "test"? I have a feeling one of my builds isn't using the right settings.

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

Jam2 posted:

What's the best way to make this readable and within 80 chars per line?

code:
      Listing.within(@region).includes(:region).where('category_id = ?', params[:category_id]).text_search(params[:query])

code:
Listings.find_for_region_category_and_query(@region, params[:category_id], params[:query])
Implementation of Listings.find_for_region_category_and_query should be self-explanatory. You're basically gonna hide the ugly in the model.

Jam2
Jan 15, 2008

With Energy For Mayhem
Thanks, guys. I like that style. I'm going to change it a bit to appease the skeptic in me that thinks Ruby might misinterpret the new line. Putting the periods on the same line seems a bit more sane.

code:
    @listings = Listing.
      in(@region).
      includes(:region).
      text_search(params[:query]).
      order('created_at DESC').
      scoped

prom candy
Dec 16, 2005

Only I may dance
Bonzo is right that at a certain point you should be moving those types of calls to the model.

manero
Jan 30, 2006

prom candy posted:

Bonzo is right that at a certain point you should be moving those types of calls to the model.

Always move those types of calls into the model :)

prom candy
Dec 16, 2005

Only I may dance
Well then you end up with a little problem I like to call "Skinny Controller / Morbidly Obese Model." I don't think chaining two AR relations is automatic grounds for putting it in the model. When you're starting to have to break it on to separate lines then yeah, it's probably model time.

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

prom candy posted:

Well then you end up with a little problem I like to call "Skinny Controller / Morbidly Obese Model." I don't think chaining two AR relations is automatic grounds for putting it in the model. When you're starting to have to break it on to separate lines then yeah, it's probably model time.

If your models are "morbidly obese" they probably do too much, either simulating some kind of entity that the model doesn't directly represent (in which case you should create a new model that doesn't inherit from anything to encapsulate that behavior), or some extra behavior (that can be refactored into a Concern).

Ruby code:
Listing.
  within(@region).includes(:region).
  where('category_id = ?', params[:category_id]).
  text_search(params[:query])
This might be better served as a ListingQuery or a method off of Region:
Ruby code:
ListingQuery.new(params, region: @region) # unpacks :category_id and :query from params

@region.listings_query(params[:query]).where(category_id: params[:category_id])

hepatizon
Oct 27, 2010

prom candy posted:

Well then you end up with a little problem I like to call "Skinny Controller / Morbidly Obese Model." I don't think chaining two AR relations is automatic grounds for putting it in the model. When you're starting to have to break it on to separate lines then yeah, it's probably model time.

IMO, the rules for moving controller code into a model method are about the same as moving model code into its own method:
- do you need to use the same code in multiple places?
- are you indenting too deep?

A moderately complex query is fine in the controller. But if you have to abstract it out for reuse/simplicity, the model is the place to do it.

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

hepatizon posted:

A moderately complex query is fine in the controller. But if you have to abstract it out for reuse/simplicity, the model is the place to do it.

There may even be a better way to split it up.

Complex queries are probably going to have two parts: business object manipulation (I want the posts joined with their user) and formatting for display (I want page 6 and posts sorted by rating).

Using ActiveRecord you can break that up.

Ruby code:
# model
class Thread
  def replies
    self.posts.include :user
  end
end

# controller
@posts = @thread.replies.limit(20).offset(params[:page] * 20)

hepatizon
Oct 27, 2010

BonzoESC posted:

(that can be refactored into a Concern).

Thanks for getting me reading about ActiveSupport::Concern -- I'm not even using ActiveRecord, but my modules are much cleaner now. I've always disliked the ClassMethods idiom, and recently I realized that pure Ruby is not equipped for handling "super" calls from modules that include other modules. Concern takes care of it all. Awesome.

dexter
Jun 24, 2003

Nybble posted:

Is there a way in Github/Git to be notified when someone in your organization makes changes to a certain set of folders or files? My feet keep getting stepped on by another developer adding things without my knowledge and things end up breaking.

On a rails specific note, how can I check now or ensure that when I deploy, it gets marked as "test"? I have a feeling one of my builds isn't using the right settings.

Are these things that should be caught within your test suite/CI server?

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

Nybble posted:

Is there a way in Github/Git to be notified when someone in your organization makes changes to a certain set of folders or files? My feet keep getting stepped on by another developer adding things without my knowledge and things end up breaking.

Work in your own branch, and pick and choose what you merge.

Nybble posted:

On a rails specific note, how can I check now or ensure that when I deploy, it gets marked as "test"? I have a feeling one of my builds isn't using the right settings.
What are you trying to do?

hmm yes
Dec 2, 2000
College Slice
Hey Pardot, Postgres.app looks pretty sweet, well done. Getting Postgres up and running was a giant pain the rear end and would continue to be if we didn't have the hoops to jump through recorded in a text file, so I'm looking forward to just using this. Just checked out the updated version of Induction, too. It's also coming along nicely.

Pardot
Jul 25, 2001




atastypie posted:

Hey Pardot, Postgres.app looks pretty sweet, well done. Getting Postgres up and running was a giant pain the rear end and would continue to be if we didn't have the hoops to jump through recorded in a text file, so I'm looking forward to just using this. Just checked out the updated version of Induction, too. It's also coming along nicely.

Thanks all the credit goes to one of my coworkers. Also super cool is postgresapp comes with postgis and plv8 so you can play with those without having to compile them yourself.

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

prom candy
Dec 16, 2005

Only I may dance
I found installing postgres with homebrew to be a breeze.

Does anyone know if there's a way to get Heroku to skip asset compilation if you haven't actually changed any assets? Or does it not matter because each push spins up a fresh dyno with no memory of past dynos?

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

prom candy posted:

I found installing postgres with homebrew to be a breeze.

Does anyone know if there's a way to get Heroku to skip asset compilation if you haven't actually changed any assets? Or does it not matter because each push spins up a fresh dyno with no memory of past dynos?

Each push is going to create a new slug with no memory of past slugs.

Edit: if you want it to go faster, push your assets to S3 and CloudFront, and disable asset compilation.

Jam2
Jan 15, 2008

With Energy For Mayhem

atastypie posted:

Hey Pardot, Postgres.app looks pretty sweet, well done. Getting Postgres up and running was a giant pain the rear end and would continue to be if we didn't have the hoops to jump through recorded in a text file, so I'm looking forward to just using this. Just checked out the updated version of Induction, too. It's also coming along nicely.

gently caress that. i've wasted my afternoon trying to get my tools up and running again after breaking my perfectly-good postgres install trying to get this working.

Now, when I rails s, I get:
code:
/Users/jam2/.rvm/gems/ruby-1.9.2-p318/gems/pg-0.14.0/lib/pg.rb:4:in `require': dlopen(/Users/jam2/.rvm/gems/ruby-1.9.2-p318/gems/pg-0.14.0/lib/pg_ext.bundle, 9): Library not loaded: /opt/local/lib/postgresql91/libpq.5.dylib (LoadError)
and when I psql, I get

code:
Jam2s-MacBook-Pro-4:vern brian$ psql
dyld: Library not loaded: /usr/lib/libpq.5.dylib
  Referenced from: /usr/bin/psql
  Reason: image not found
Trace/BPT trap: 5
I'm a first-timer with a fragile development setup who tried to make it simpler with this encapsulated binary. False advertising...

prom candy
Dec 16, 2005

Only I may dance
Did you install postgres with macports and then again via another method? I would delete the macports version (backing up your data) and then wipe your gems folder for your project and bundle install again. It seems like your pg gem was compiled against one version of Postgres that's no longer available.

Trabisnikof
Dec 24, 2005

prom candy posted:

Did you install postgres with macports and then again via another method? I would delete the macports version (backing up your data) and then wipe your gems folder for your project and bundle install again. It seems like your pg gem was compiled against one version of Postgres that's no longer available.

By googling "libpq" I noticed one of the first results dealt with an issue with the default installation options of Homebrew. So, I think a "which psql" might be useful.

Jam2
Jan 15, 2008

With Energy For Mayhem

prom candy posted:

Did you install postgres with macports and then again via another method? I would delete the macports version (backing up your data) and then wipe your gems folder for your project and bundle install again. It seems like your pg gem was compiled against one version of Postgres that's no longer available.


gems folder? Do you mean delete gemfile.lock? I've never heard of the gems folder. Where can I find it?

When I installed postgres a few weeks back, I exhausted macports and brew in attempts to get it going. I don't remember which finally succeeded.

Here's what's installed via port:

code:
Brians-MacBook-Pro-4:vern brian$ port installed
Warning: port definitions are more than two weeks old, consider using selfupdate
The following ports are currently installed:
  autoconf @2.68_2 (active)
  automake @1.11.1_0
  automake @1.11.3_0 (active)
  bison @2.5_0 (active)
  boost @1.49.0_0+universal (active)
  bzip2 @1.0.6_0
  bzip2 @1.0.6_0+universal (active)
  cairo @1.10.2_4+x11
  cairo @1.12.0_0+x11 (active)
  db46 @4.6.21_6 (active)
  dbus @1.4.16_0
  dbus @1.4.18_0 (active)
  expat @2.0.1_1
  expat @2.0.1_1+universal
  expat @2.1.0_0+universal (active)
  fontconfig @2.8.0_0
  fontconfig @2.9.0_1 (active)
  freetype @2.4.7_0
  freetype @2.4.9_1 (active)
  gdbm @1.9.1_0
  gdbm @1.10_1 (active)
  gettext @0.18.1.1_2 (active)
  ghostscript @9.05_0 (active)
  glib2 @2.28.8_0
  glib2 @2.30.3_0 (active)
  googlecl @0.9.13_2 (active)
  gperf @3.0.4_2
  gperf @3.0.4_2+universal (active)
  help2man @1.40.4_1
  help2man @1.40.5_2 (active)
  icu @4.8.1_0+universal (active)
  imagemagick @6.7.6-0_0+q16 (active)
  ipe @7.0.14_1
  ipe @7.1.2_0 (active)
  jbig2dec @0.11_1 (active)
  jpeg @8c_0
  jpeg @8d_0 (active)
  lcms @1.19_2 (active)
  lcms2 @2.3_0 (active)
  libedit @20110802-3.0_0 (active)
  libffi @3.0.10_2 (active)
  libiconv @1.14_0
  libiconv @1.14_0+universal (active)
  libidn @1.22_0 (active)
  liblzma @5.0.3_0 (active)
  libmms @0.6.2_0 (active)
  libmng @1.0.10_2 (active)
  libpaper @1.1.24_0 (active)
  libpixman @0.22.2_1
  libpixman @0.24.4_0 (active)
  libpng @1.4.8_0
  libpng @1.4.10_0
  libpng @1.4.11_0 (active)
  libtool @2.4.2_0 (active)
  libxml2 @2.7.8_0 (active)
  libxslt @1.1.26_0 (active)
  lua @5.1.4_4 (active)
  m4 @1.4.16_0 (active)
  makeicns @1.4.9_0
  makeicns @1.4.10_0 (active)
  mimms @3.2.1_1 (active)
  ncurses @5.9_1 (active)
  ncursesw @5.8_0 (active)
  openssl @1.0.0e_1
  openssl @1.0.1_2 (active)
  ossp-uuid @1.6.2_0 (active)
  p5.12-locale-gettext @1.50.0_6 (active)
  perl5 @5.12.3_1+perl5_12 (active)
  perl5.12 @5.12.3_2
  perl5.12 @5.12.3_3 (active)
  pkgconfig @0.26_0
  pkgconfig @0.26_1 (active)
  py27-distribute @0.6.24_0
  py27-distribute @0.6.25_0 (active)
  py27-gdata @2.0.14_0
  py27-gdata @2.0.15_0 (active)
  python26 @2.6.7_4 (active)
  python27 @2.7.2_1
  python27 @2.7.2_4 (active)
  python_select @0.3_1 (active)
  qt4-mac @4.7.4_1+quartz (active)
  readline @6.2.000_0 (active)
  sqlite3 @3.7.8_1
  sqlite3 @3.7.11_0 (active)
  tiff @3.9.5_0 (active)
  urw-fonts @1.0.7pre44_0 (active)
  webp @0.1.3_0 (active)
  xorg-bigreqsproto @1.1.1_0
  xorg-bigreqsproto @1.1.2_0 (active)
  xorg-inputproto @2.0.99.1_0
  xorg-inputproto @2.2_0 (active)
  xorg-kbproto @1.0.5_0
  xorg-kbproto @1.0.6_0 (active)
  xorg-libice @1.0.8_0 (active)
  xorg-libpthread-stubs @0.3_0 (active)
  xorg-libsm @1.2.1_0 (active)
  xorg-libX11 @1.4.4_0
  xorg-libX11 @1.4.99.901_0 (active)
  xorg-libXau @1.0.6_0
  xorg-libXau @1.0.7_0 (active)
  xorg-libxcb @1.7_0+python27
  xorg-libxcb @1.8.1_1+python27 (active)
  xorg-libXdmcp @1.1.0_0
  xorg-libXdmcp @1.1.1_0 (active)
  xorg-libXext @1.3.1_0 (active)
  xorg-libXt @1.1.3_0 (active)
  xorg-renderproto @0.11.1_0 (active)
  xorg-util-macros @1.15.0_0
  xorg-util-macros @1.17_0 (active)
  xorg-xcb-proto @1.6_0+python27
  xorg-xcb-proto @1.7.1_0+python27 (active)
  xorg-xcb-util @0.3.8_0 (active)
  xorg-xcmiscproto @1.2.1_0
  xorg-xcmiscproto @1.2.2_0 (active)
  xorg-xextproto @7.2.0_0
  xorg-xextproto @7.2.1_0 (active)
  xorg-xf86bigfontproto @1.2.0_0 (active)
  xorg-xproto @7.0.22_0
  xorg-xproto @7.0.23_0 (active)
  xorg-xtrans @1.2.6_0
  xorg-xtrans @1.2.7_0 (active)
  xrender @0.9.6_1
  xrender @0.9.7_0 (active)
  xz @5.0.3_0 (active)
  zlib @1.2.5_0
  zlib @1.2.6_0
  zlib @1.2.6_0+universal (active)
I'm trying to see if it's installed via bew, but my brew isn't working:

code:
Brians-MacBook-Pro-4:vern brian$ brew list
xcrun: Error: failed to exec real xcrun. (No such file or directory)


here's what happens when I try to gem install pg:

code:
Building native extensions.  This could take a while...
ERROR:  Error installing pg:
	ERROR: Failed to build gem native extension.

        /Users/brian/.rvm/rubies/ruby-1.9.2-p318/bin/ruby extconf.rb
checking for pg_config... yes
Using config values from /usr/bin/pg_config
checking for libpq-fe.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
	--with-opt-dir
	--with-opt-include
	--without-opt-include=${opt-dir}/include
	--with-opt-lib
	--without-opt-lib=${opt-dir}/lib
	--with-make-prog
	--without-make-prog
	--srcdir=.
	--curdir
	--ruby=/Users/brian/.rvm/rubies/ruby-1.9.2-p318/bin/ruby
	--with-pg
	--without-pg
	--with-pg-dir
	--without-pg-dir
	--with-pg-include
	--without-pg-include=${pg-dir}/include
	--with-pg-lib
	--without-pg-lib=${pg-dir}/lib
	--with-pg-config
	--without-pg-config
	--with-pg_config
	--without-pg_config
/Users/brian/.rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/mkmf.rb:368:in `try_do': The complier failed to generate an executable file. (RuntimeError)
You have to install development tools first.
	from /Users/brian/.rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/mkmf.rb:452:in `try_cpp'
	from /Users/brian/.rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/mkmf.rb:853:in `block in find_header'
	from /Users/brian/.rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/mkmf.rb:693:in `block in checking_for'
	from /Users/brian/.rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/mkmf.rb:280:in `block (2 levels) in postpone'
	from /Users/brian/.rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/mkmf.rb:254:in `open'
	from /Users/brian/.rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/mkmf.rb:280:in `block in postpone'
	from /Users/brian/.rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/mkmf.rb:254:in `open'
	from /Users/brian/.rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/mkmf.rb:276:in `postpone'
	from /Users/brian/.rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/mkmf.rb:692:in `checking_for'
	from /Users/brian/.rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/mkmf.rb:852:in `find_header'
	from extconf.rb:41:in `<main>'


Gem files will remain installed in /Users/brian/.rvm/gems/ruby-1.9.2-p318/gems/pg-0.14.0 for inspection.
Results logged to /Users/brian/.rvm/gems/ruby-1.9.2-p318/gems/pg-0.14.0/ext/gem_make.out

Pardot
Jul 25, 2001




If the pg gem was previously compiled against a different libpq, you're going to have to get rid of it and re build with the one you're using. If it's trying to get at one in /opt/... that's not postgres.app

edit:

http://postgresapp.com/documentation#toc_15
For best results, you should remove any existing installation of PostgreSQL. Here's a run-down of the most common ways you may have installed it previously:


http://postgresapp.com/documentation#toc_20

Binaries: /Applications/Postgres.app/Contents/MacOS/bin
Headers: /Applications/Postgres.app/Contents/MacOS/include
Libraries: /Applications/Postgres.app/Contents/MacOS/lib
Shared Libraries: /Applications/Postgres.app/Contents/MacOS/share
Data: ~/Library/Containers/com.heroku.Postgres/Data/Library/Application\ Support/Postgres/var

Pardot fucked around with this message at 06:00 on Jul 20, 2012

Jam2
Jan 15, 2008

With Energy For Mayhem

Trabisnikof posted:

By googling "libpq" I noticed one of the first results dealt with an issue with the default installation options of Homebrew. So, I think a "which psql" might be useful.

/usr/bin/psql

Jam2
Jan 15, 2008

With Energy For Mayhem

Pardot posted:

If the pg gem was previously compiled against a different libpq, you're going to have to get rid of it and re build with the one you're using. If it's trying to get at one in /opt/... that's not postgres.app

edit:

http://postgresapp.com/documentation#toc_15
For best results, you should remove any existing installation of PostgreSQL. Here's a run-down of the most common ways you may have installed it previously:


http://postgresapp.com/documentation#toc_20

Binaries: /Applications/Postgres.app/Contents/MacOS/bin
Headers: /Applications/Postgres.app/Contents/MacOS/include
Libraries: /Applications/Postgres.app/Contents/MacOS/lib
Shared Libraries: /Applications/Postgres.app/Contents/MacOS/share
Data: ~/Library/Containers/com.heroku.Postgres/Data/Library/Application\ Support/Postgres/var



code:
Brians-MacBook-Pro-4:vern brian$ brew remove postgresql
xcrun: Error: failed to exec real xcrun. (No such file or directory)
Error: No such keg: /usr/local/Cellar/postgresql
code:
Brians-MacBook-Pro-4:vern brian$ sudo port uninstall postgres
Password:
Warning: port definitions are more than two weeks old, consider using selfupdate
code:
Brians-MacBook-Pro-4:vern brian$ sudo port selfupdate
--->  Updating MacPorts base sources using rsync
MacPorts base version 2.0.4 installed,
MacPorts base version 2.1.1 downloaded.
--->  Updating the ports tree
--->  MacPorts base is outdated, installing new version 2.1.1
Installing new MacPorts release in /opt/local as root:admin; permissions 0755; Tcl-Package in /Library/Tcl

Error: /opt/local/bin/port: port selfupdate failed: Error installing new MacPorts base: shell command failed (see log for details)
Deadend... where's the log?

Pardot
Jul 25, 2001




What is the output of `pg_config` ? and then see if it's better with `PATH=/Applications/Postgres.app/Contents/MacOS/bin:$PATH pg_config`

Jam2
Jan 15, 2008

With Energy For Mayhem

Pardot posted:

What is the output of `pg_config` ? and then see if it's better with `PATH=/Applications/Postgres.app/Contents/MacOS/bin:$PATH pg_config`

code:
Brians-MacBook-Pro-4:vern brian$ pg_config
BINDIR = /usr/bin
DOCDIR = /usr/share/doc/postgresql
HTMLDIR = /usr/share/postgresql
INCLUDEDIR = /usr/include
PKGINCLUDEDIR = /usr/include/postgresql
INCLUDEDIR-SERVER = /usr/include/postgresql/server
LIBDIR = /usr/lib
PKGLIBDIR = /usr/lib/postgresql
LOCALEDIR = /usr/share/locale
MANDIR = /usr/share/man
SHAREDIR = /usr/share/postgresql
SYSCONFDIR = /private/etc/postgresql
PGXS = /usr/lib/postgresql/pgxs/src/makefiles/pgxs.mk
CONFIGURE = '--infodir=/usr/share/info' '--disable-dependency-tracking' '--prefix=/usr' '--sbindir=/usr/libexec' '--sysconfdir=/private/etc' '--mandir=/usr/share/man' '--localstatedir=/private/var/pgsql' '--htmldir=/usr/share/postgresql' '--enable-thread-safety' '--enable-dtrace' '--with-tcl' '--with-perl' '--with-python' '--with-gssapi' '--with-krb5' '--with-pam' '--with-ldap' '--with-bonjour' '--with-openssl' '--with-libxml' '--with-libxslt' '--with-system-tzdata=/usr/share/zoneinfo' 'CC=/Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.8.xctoolchain/usr/bin/cc' 'CFLAGS=-arch x86_64 -pipe -Os -g -Wall -Wno-deprecated-declarations' 'LDFLAGS=-arch x86_64 -pipe -Os -g -Wall -Wno-deprecated-declarations' 'LDFLAGS_EX=-mdynamic-no-pic'
CC = /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.8.xctoolchain/usr/bin/cc
CPPFLAGS = -I/usr/include/libxml2
CFLAGS = -arch x86_64 -pipe -Os -g -Wall -Wno-deprecated-declarations -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wformat-security -fno-strict-aliasing -fwrapv
CFLAGS_SL = 
LDFLAGS = -arch x86_64 -pipe -Os -g -Wall -Wno-deprecated-declarations -Wl,-dead_strip_dylibs
LDFLAGS_EX = -mdynamic-no-pic
LDFLAGS_SL = 
LIBS = -lpgport -lxslt -lxml2 -lpam -lssl -lcrypto -lgssapi_krb5 -lz -lreadline -lm 
VERSION = PostgreSQL 9.1.4

Jam2
Jan 15, 2008

With Energy For Mayhem
Do I enter this into .profile exactly as shown?

code:
`PATH=/Applications/Postgres.app/Contents/MacOS/bin:$PATH pg_config`

Pardot
Jul 25, 2001




Jam2 posted:

Do I enter this into .profile exactly as shown?

code:
`PATH=/Applications/Postgres.app/Contents/MacOS/bin:$PATH pg_config`

pg_config just shows you what is going on, it doesn't change anything.

If your env was set up to use postgres.app it'd look something like this

code:
BINDIR = /Applications/Postgres.app/Contents/MacOS/bin
DOCDIR = /Applications/Postgres.app/Contents/MacOS/share/doc
HTMLDIR = /Applications/Postgres.app/Contents/MacOS/share/doc
INCLUDEDIR = /Applications/Postgres.app/Contents/MacOS/include
PKGINCLUDEDIR = /Applications/Postgres.app/Contents/MacOS/include
INCLUDEDIR-SERVER = /Applications/Postgres.app/Contents/MacOS/include/server
LIBDIR = /Applications/Postgres.app/Contents/MacOS/lib
PKGLIBDIR = /Applications/Postgres.app/Contents/MacOS/lib
LOCALEDIR = /Applications/Postgres.app/Contents/MacOS/share/locale
MANDIR = /Applications/Postgres.app/Contents/MacOS/share/man
SHAREDIR = /Applications/Postgres.app/Contents/MacOS/share
SYSCONFDIR = /Applications/Postgres.app/Contents/MacOS/etc
PGXS = /Applications/Postgres.app/Contents/MacOS/lib/pgxs/src/makefiles/pgxs.mk
CONFIGURE = '--prefix=/Users/mattt/Code/heroku/PostgresApp/Postgres/Vendor/postgres' '--enable-thread-safety' '--without-docdir' '--with-openssl' '--with-gssapi' '--with-bonjour' '--with-krb5' '--with-libxml' '--with-libxslt' '--with-ossp-uuid' '--with-perl' '--with-python'
CC = gcc
CPPFLAGS = -I/usr/include/libxml2f
CFLAGS = -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wformat-security -fno-strict-aliasing -fwrapv
CFLAGS_SL = 
LDFLAGS = -Wl,-dead_strip_dylibs
LDFLAGS_EX = 
LDFLAGS_SL = 
LIBS = -lpgport -lxslt -lxml2 -lssl -lcrypto -lgssapi_krb5 -lz -lreadline -lm 
VERSION = PostgreSQL 9.1.3
So your env not pointing at the postgres in /Applications, and therefore compiling the pg gem and linking the correct libpq wont happen. I'm not exactly sure what you need to do to fix that, but hopefully this points you in the right direction.

prom candy
Dec 16, 2005

Only I may dance

Jam2 posted:

gems folder? Do you mean delete gemfile.lock? I've never heard of the gems folder. Where can I find it?

I'm going to let pardot keep helping you as he has a lot more experience in this than I do, but I was referring to the folder where bundler installs your gems. Generally it's a good idea to keep your gems installed in your project folder( Vendor Everything Still Applies) but if you're using gemsets you might just need to gem uninstall pg.

That's after doing the things that pardot is recommending as it seems like you may have postgres installed in a few different places. It's a road we've all been down.

wolfman101
Feb 8, 2004

PCXL Fanboy
Since there isn't a general ruby thread I thought I would just post this here.

I am going the full Uncle Bob and trying to make a memory based instance handling system inspired by his lost years of architecture talk. I have an early version, which still needs a few features to be truly useful, but it is good enough that I was able to hook it into a simple sinatra app with user registration and login and user registration and login works.

Anyway, I was looking to see if anyone wanted to get in on this or call me an idiot or both.

https://github.com/kwstannard/the_blob

Also, I am looking for a better name than the_blob.

prom candy
Dec 16, 2005

Only I may dance
What's the use case for this? Or is it a learning project?

hepatizon
Oct 27, 2010

wolfman101 posted:

memory based instance handling system

Is this an established concept that I can learn about without watching a 66-minute video?

prom candy
Dec 16, 2005

Only I may dance

hepatizon posted:

Is this an established concept that I can learn about without watching a 66-minute video?

That video is really worth watching, it's not centered around memory based instance handling systems at all. It's about the separation of concerns and program architecture and it's really, really interesting.

Adbot
ADBOT LOVES YOU

wolfman101
Feb 8, 2004

PCXL Fanboy

prom candy posted:

What's the use case for this? Or is it a learning project?

This started out as a learning project to try making an app that would eventually need a database, but to push that decision back until the last possible minute and thereby create a consistent framework that you can build an app on top of and plug in any sort of persistance you want without having to change anything in the app itself.

As of right now I think the memory based persistance system, i.e. caching, is fully functional, and I think the next thing in line is a Sequel interface.

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