paperclip installation error - paperclip

I cannot understand the reason for failing the installation:
pkerur#ubuntu:~$ rails --version
Rails 3.2.3
pkerur#ubuntu:~$ uname -a
Linux ubuntu 3.2.0-24-generic #38-Ubuntu SMP Tue May 1 16:21:07 UTC 2012 i686 i686 i386 GNU/Linux
pkerur#ubuntu:~$ ruby --version
ruby 1.9.3p0 (2011-10-30 revision 33570) [i686-linux]
pkerur#ubuntu:~$ sudo gem install paperclip
ERROR: Error installing paperclip:
paperclip requires Ruby version >= 1.9.2.
pkerur#ubuntu:~$

bundle install and ruby versions?
Build it from source:
http://excid3.com/blog/setting-up-ubuntu-12-04-with-ruby-1-9-3-nginx-passenger-and-postgresql-or-mysql/

There is a hard difference between sudo command and command, because sudo'ing messed up the environmental variables. I bet if you do sudo ruby -v it will not be 1.9.3.
The solution would depend on many things. Try rvm? Try gemsets? Make whatever folder writeable by non-superuser to not require sudo? (sudo chown <your_yourname> <directory> -R)

Related

Unable to install Ruby OpenSSL

So, I just updated Ruby version on a CentOS 7 box, to allow for the use of OpenSSL, using this guide:
https://www.server-world.info/en/note?os=CentOS_7&p=ruby23
However, the version is now set to 2.3.8 as per:
$ ruby -v
ruby 2.3.8p459 (2018-10-18 revision 65136) [x86_64-linux]
and:
$ which ruby
/opt/rh/rh-ruby23/root/usr/bin/ruby
$ which gem
/opt/rh/rh-ruby23/root/usr/bin/gem
BUT, gem throws the same error as before hand:
$ sudo gem install openssl
ERROR: Error installing openssl:
openssl requires Ruby version >= 2.3.0.
Any ideas?
Try installing gems without sudo. I did such test locally
$ ruby -v
ruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-linux]
$ sudo ruby -v
sudo: ruby: command not found
Probably your superuser env is not using the same ruby version as your current user's env.

Wrong Ruby on Mac OS X 10.12 Sierra

I have gone about the recommended way of installing a new version of Ruby on Mac OS X: Homebrew, and rvm. I ran rbenv to install Ruby 2.3.3, and selected it as the preferred version by using "rbenv global 2.3.3". The problem I am having is that there is currently a 2.0.0 version installed at /usr/bin/ruby, and for some crazy reason I am unable to remove it.
$ rbenv global
2.3.3
$ which ruby
/usr/bin/ruby
$ ruby -v
ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin16]
$ ~/.rbenv/versions/2.3.3/bin/ruby -v
ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-darwin16]
sudo rm -rf /usr/bin/ruby
Password:
rm: /usr/bin/ruby: Operation not permitted
Argh!! Please help.
The problem is not your system Ruby, the problem is you probably didn't follow the rbenv installation instructions completely correctly.
The reason the system Ruby is located before your rbenv Ruby, is because your PATH has not been properly updated.
This explains why that is important:
https://github.com/rbenv/rbenv#understanding-path
To set up your PATH correctly you can read and complete steps 2-4 here:
https://github.com/rbenv/rbenv#basic-github-checkout

Can't find ruby or gem commands after doing ruby-install in Ubuntu

I have installed ruby 1.9.3 in my Ubuntu 12.04 machine following the instructions in https://github.com/postmodern/ruby-install and executing the following command:
sudo ruby-install ruby 1.9.3
I was assuming this would link from my /usr/bin or somewhere else visible from my path ruby or gem, but it doesn't. When I try for example: gem install bundler, I get:
sudo: gem: command not found
It also can't find ruby when I try ruby -v.
If I install with sudo apt-get install ruby1.9.3, I'm able to execute both ruby and gem:
$ ruby -v
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]
$ gem -v
1.8.11
I was expecting from ruby-install the same output I got from apt-get. Am I looking in the wrong place? How do I run ruby and gem after installing with ruby-install?
I know there are other installers for ruby like rvm and rbenv, but I'm following some installations instructions and they clearly instruct to use ruby-install.
Thanks in advance!
OK, found the answer.
After running
sudo ruby-install ruby 1.9.3
the last line from the log is:
>>> Successfully installed ruby 1.9.3-p547 into /opt/rubies/ruby-1.9.3-p547
Which I have no excuse for not paying attention to since it's in bold colourfull letters.
Erm, anyway, adding /opt/rubies/ruby-1.9.3-p547 to the PATH makes ruby and gem work.
export PATH=$PATH:/opt/rubies/ruby-1.9.3-p547/bin

Need to remove ruby to install cocoapods

I'm trying to install cocaopods on my Mac Yosemite system. However, when I type in this command:
$ sudo gem install cocoapods
It returns this error:
ERROR: Error installing cocoapods:
i18n requires Ruby version >= 1.9.3.
Typing which ruby, returns:
/Users/myname/.rvm/rubies/ruby-1.9.2-p180/bin/ruby
typing rvm rubies gives this message:
rvm rubies
ruby-1.8.7-p334 [ x86_64 ]
=> ruby-1.9.2-p180 [ x86_64 ]
However, typing /usr/bin/ruby --version gives this message:
ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin14]
I'm thinking if I can uninstall the ruby that's in my home directory, the cocoapods install will find the more recent ruby version. However, I'm not not sure exactly how to do that and/or what impact it would have. Any suggestions?
Looks like you have rvm installed when you don't want to. You can remove it entirely with rvm implode. Then when you open a new shell which -a ruby should just show /usr/bin/ruby

Abort trap segmentation fault with ruby when using heroku OSX terminal commands

Note: I'm not even using ruby (using django), but ruby is in my computer's path so it seems to be bringing up errors.
When I run any heroku commands (heroku status, heroku login), I get the following error:
/usr/local/heroku/vendor/gems/excon-0.14.0/lib/excon/ssl_socket.rb:74: [BUG] Segmentation fault
ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
Abort trap
even though ruby -v returns:
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin10.8.0]
and I did rvm remove ruby-1.8.7.
Anyone know of a fix? Have searched far and wide to no avail. Thank you!
Apple deprecated the use of OpenSSL in OSX Lion.
You have to specify where to find the new location for openssl.
If you're using Macports:
port install openssl
rvm reinstall 1.9.3 -C --with-openssl-dir=/opt/local
rvm use 1.9.3
If you're using Homebrew:
brew install openssl
rvm reinstall 1.9.3 -C --with-openssl-dir=/usr/local
rvm use 1.9.3
Another options is to build OpenSSL as a package in RVM:
rvm pkg install openssl
rvm reinstall 1.9.3 -C --with-openssl-dir=~/.rvm/usr
rvm use 1.9.3
this should work for any build of Ruby, just replace the version number.

Resources