1
votes

I have been trying to install and run rubyonrails in my macbook Snow Leoppard 10.6.8, with Ruby 1.9.2-p290.

When I write bundle install im having this problem, not just with Postgres also with SQLite and MySQL.

Installing pg (0.11.0) /Users/felipevelasquez/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:585:in initialize': Permission denied -/Users/felipevelasquez/.rvm/gems/ruby-1.9.2-p290/gems/pg-0.11.0/Rakefile` (Errno::EACCES)

When I write sudo bundle install I have this:

/Users/felipevelasquez/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find bundler (>= 0) amongst [mime-types-1.16, minitest-1.6.0, rack-1.3.2, rake-0.8.7, rdoc-2.5.8, rest-client-1.6.7, sequel-3.20.0, sinatra-1.0, sqlite3-1.3.4, sqlite3-ruby-1.3.3, taps-0.3.23] (Gem::LoadError)

1
You shouldn't be using sudo for a bundle install.x1a4
I did it, but i have this: sudo bundle install /Users/felipevelasquez/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find bundler (>= 0) amongst [mime-types-1.16, minitest-1.6.0, rack-1.3.2, rake-0.8.7, rdoc-2.5.8, rest-client-1.6.7, sequel-3.20.0, sinatra-1.0, sqlite3-1.3.4, sqlite3-ruby-1.3.3, taps-0.3.23] (Gem::LoadError)Pipevel
Don't use sudo. It's probably the cause of this in the first place. rvm makes sudo unnecessary.x1a4
Then i have this: Errno::EACCES: Permission denied - /Users/felipevelasquez/.rvm/gems/ruby-1.9.2-p290/gems/pg-0.11.0/Rakefile An error occured while installing pg (0.11.0), and Bundler cannot continue. Make sure that gem install pg -v '0.11.0' succeeds before bundling.Pipevel
You've used sudo for other things you shouldn't have. You should uninstall rvm and reinstall it, and all your gems as well without sudo.x1a4

1 Answers

-1
votes

Cause of this problem is this: this could be a rvm bug, I have experienced too earlier.

the directory to write has no permission, while you escalating the privilege, the gem env and PATH info is not passed into it.

You can either try to install rvm and ruby. OR export your env and path with sudo command. for example:

sudo export GEM_HOME = /path/to/gem_home && bundle install