Which only adds the host line to what is shown in the tutorial.
After confirming that the pg gem is installed I tried two things:
first install the libdbd-pg-ruby package for Ubuntu, and then replaced
the pg gem for postgres-pr, as suggested here:
Browsing a bit more I stumbled on a suggestion to install yet another gem: postgres. This gem doesn’t even install:
$ gem install postgres
Fetching: postgres-0.7.9.2008.01.28.gem (100%)
Building native extensions. This could take a while…
ERROR: Error installing postgres:
ERROR: Failed to build gem native extension.
Gem files will remain installed in /home/desousa/.rvm/gems/ruby-1.9.2-p290/gems/postgres-0.7.9.2008.01.28 for inspection.
Results logged to /home/desousa/.rvm/gems/ruby-1.9.2-p290/gems/postgres-0.7.9.2008.01.28/ext/gem_make.out
What’s the issue with this particular gem?
So far I tried 3 different gems for postgres adapter, each recommended at different places on the web. Is there an “official” Rails gem for postgres? Or an “official” adapter install guide?
I managed to get rake db:create to work, it requires the creation of an application with the -d postgresql argument. Nevertheless, it throws a strange message saying that the database already exists. I will move onwards with the tutorial to see if it really works.
I think this issue should be made clear on the tutorial; some basic guidelines on which adapter to use could also be helpful.
Our time is limited with them so we’re only sure that everything gets installed, but we’ve gotten six ubuntu workstations configured and next week should actually spin up a demo rails app.
I managed to get rake db:create to work, it requires the creation of an
application with the -d postgresql argument. Nevertheless, it throws a
strange message saying that the database already exists. I will move onwards
with the tutorial to see if it really works.
Yes: to create a postgresql based application, you need to use the "-d
postgresql" argument, if you forgot it, just open the Gemfile and add
the instruction "gem 'pg'" instead of "gem 'sqlite3'" and update the
bundle with the command-line "bundle update".
I'm using postgresql 9.1 on ubuntu 11.04 with rails 3.1, and
everything's good for me.
Oh and, don't forget to install the 'pg' gem with the command-line
"gem install 'pg'".
You should install PgAdmin 3 to manage your database with an user
interface. It's very helpfull to see if you database is already
created or some other few issues...
That not exactly the same issue, I'd say an authoritative install
guide for Ubuntu is definitely needed, especially since a direct
install from the repositories won't work.
I used this guide which got Rails and Ruby to work on Ubuntu 10.10 64-
bit:
One can only forget things one has learned in the past. I'll stick to
postgres-pr for now, it is recommended in several places on the web
and so far seems to work without trouble.