0
votes

Error with 'gem install sqlite3'

'ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.'

And this error while 'sudo gem install sqlite3'

"1 warning generated. compiling exception.c compiling sqlite3.c compiling statement.c linking shared-object sqlite3/sqlite3_native.bundle clang: error: unknown argument: '-multiply_definedsuppress' [-Wunused-command-line-argument-hard-error-in-future] clang: note: this will be a hard error (cannot be downgraded to a warning) in the future make: * [sqlite3_native.bundle] Error 1

make failed, exit code 2

Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/sqlite3-1.3.9 for inspection. Results logged to /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-13/2.0.0/sqlite3-1.3.9/gem_make.out"

I have installed RVM and also used 'sudo' gem install sqlite3 and gem install sqlite3 . What am I missing?

Thx!

1

1 Answers

0
votes

You should not use sudo with rvm. However, it may be that your rvm default ruby is the system ruby.

To install a new ruby version using rvm:

rvm install 2.1.1

After that is installed do a rvm list to make sure it is installed:

rvm list

And you will get a list of installed rubies.

rvm rubies

   ruby-2.0.0-p247 [ x86_64 ]
   ruby-2.1.1 [ x86_64 ]

# => - current
# =* - current && default
#  * - default

Note that it will show a list. You need to select the one you just installed if it is not selected already:

 rvm use 2.1.1

Then, running rvm list again, you should see something like this:

rvm rubies

   ruby-2.0.0-p247 [ x86_64 ]
=* ruby-2.1.1 [ x86_64 ]

# => - current
# =* - current && default
#  * - default

Note the difference, and how now I have my local 2.1.1 ruby selected. Now it would be safe to run

gem install sqlite3