1

I have a rails application currently using sqlite3. Following this guide: https://devcenter.heroku.com/articles/rails3 I'm trying to switch to postgresql. I changed my gemfile but when I run bundle install I get this error:

Errno::EACCES: Permission denied - /Users/me/.rvm/gems/ruby-1.9.3-p194/gems/pg-0.14.0/.gemtest An error occured while installing pg (0.14.0), and Bundler cannot continue. Make sure that gem install pg -v '0.14.0' succeeds before bundling.

so I try gem install pg -v '0.14.0' and get this error:

ERROR: While executing gem ... (Errno::EACCES) Permission denied - /Users/me/.rvm/gems/ruby-1.9.3-p194/gems/pg-0.14.0/.gemtest

I found a few people with similar problems but I couldn't get it working. This is my first time trying to deploy a rails application so I don't have much intuition about what I'm doing.

1 Answer 1

1

Are you sure postgres itself is installed / correct? the pg gem is the rails adapter, but you also need postgres itself on the machine.

e.g.

brew install postgresql
initdb /usr/local/var/postgres
mkdir -p ~/Library/LaunchAgents
cp /usr/local/Cellar/postgresql/9.0.4/org.postgresql.postgres.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/org.postgresql.postgres.plist
rails new myapp -D postgresql
...
bundle install (install pg gem)
Sign up to request clarification or add additional context in comments.

1 Comment

Well, you were right that postgres wasn't installed, but after installing it nothing has changed. still getting the same error messages

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.