Installing gems to user directory - Configurations - How to ?

17 views
Skip to first unread message

Boopathi Rajaa

unread,
Jun 24, 2013, 9:07:31 AM6/24/13
to rubyonra...@googlegroups.com
I compiled Ruby from source, and installed it to /opt/ruby/ . 
The purpose is to have two versions of Ruby 1.9 and Ruby 1.8 ... Certain users can use 1.9

After creating a rails app (rails new app) , When a script performs `bundle install`, the gems are trying to get installed in /opt/ruby/. 
How to configure it to install it in user_home directory ?

I don't want to use the solution, where I install the gems as the root user to the ruby bin directory. 

This is the error that I get:

Gem::Exception: Cannot load gem at [/opt/ruby/lib/ruby/gems/1.9.1/cache/multi_json-1.7.7.gem] in /home/boopathi/apps/abcd
An error occurred while installing multi_json (1.7.7), and Bundler cannot continue.
Make sure that `gem install multi_json -v '1.7.7'` succeeds before bundling.

Dheeraj Kumar

unread,
Jun 24, 2013, 12:50:33 PM6/24/13
to rubyonra...@googlegroups.com

You could use rvm or rbenv instead.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/12228825-793f-4fa2-b7a1-7386c342b652%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Robert Walker

unread,
Jun 24, 2013, 12:52:09 PM6/24/13
to rubyonra...@googlegroups.com
Boopathi Rajaa wrote in post #1113443:
> I compiled Ruby from source, and installed it to /opt/ruby/ .
> The purpose is to have two versions of Ruby 1.9 and Ruby 1.8 ... Certain
> users can use 1.9
>
> After creating a rails app (rails new app) , When a script performs
> `bundle
> install`, the gems are trying to get installed in /opt/ruby/.
> How to configure it to install it in user_home directory ?
>
> I don't want to use the solution, where I install the gems as the root
> user
> to the ruby bin directory.

Are you not able to use one of the Ruby version managers?

https://github.com/sstephenson/rbenv
or
https://rvm.io

--
Posted via http://www.ruby-forum.com/.
Reply all
Reply to author
Forward
0 new messages