I have a problem installing gems for tracks. I performed the following steps:
Installation of rvm:
bash < <(curl -sk https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"' >> ~/.bashrc
source ~/.bashrc
Installation of ruby:
rvm install ruby-1.8.7
rvm use ruby-1.8.7 --default
ruby -v
Last command responds:
ruby 1.8.7 (2012-02-08 patchlevel 358) [x86_64-linux]
Git clone of tracks:
git clone https://github.com/TracksApp/tracks.git
cd tracks
nano backup.rails2.3/Gemfile.rails2.3
Changes made in this flie:
- comment out gem "sqlite3"
- change gem "ZenTest", "=4.6.0"
After this i performed bundle install which exits with the following error:
Gem::InstallError: factory_girl requires Ruby version >= 1.9.2.
An error occured while installing factory_girl (3.3.0), and Bundler cannot continue.
Make sure that `gem install factory_girl -v '3.3.0'` succeeds before bundling.
Tracks does not support ruby 1.9.x so version upgrade is not possible. How can I fix above mentioned problem?
You have cloned deveopment version which seams be getting ready for Ruby 1.9:
https://github.com/TracksApp/tracks/blob/master/Gemfile#L51
Either use it with ruby 1.9 or use older version:
https://github.com/TracksApp/tracks/tags
Related
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.
I want to install the compass html5 boilerplate gem. When I try to install it I get the following error.
$ sudo gem install html5-boilerplate
ERROR: Error installing html5-boilerplate:
compass-h5bp requires Ruby version ~> 2.0.
Then when I check my ruby version it says:
$ ruby -v
ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-linux]
But I used RVM before so I thought I could just change version but when I check it says I'm using ruby-2.2.0 already.
$ rvm list
rvm rubies
=* ruby-2.2.0 [ x86_64 ]
# => - current
# =* - current && default
# * - default
I think I must be missing something obhvious, it's been a while since I've worked with Ruby and RVM.
Update 1
I ran the below commands as suggested by #tadman and it does seem the wrong path is being used.
~:$ cd ~/.rvm/bin
bin:$ ls
ruby-rvm-env rvm rvm-auto-ruby rvm-exec rvm-prompt rvm-shebang-ruby rvm-shell rvm-smile rvmsudo
bin:$ which ruby
/usr/bin/ruby
UPDATE 2
After correcting the path in my .bash_profile the ruby version seems correct but I'm still getting the same error when trying to install the html5-boilerplate gem??
$ sudo gem install html5-boilerplate
ERROR: Error installing html5-boilerplate:
compass-h5bp requires Ruby version ~> 2.0.
$ ruby -v
ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-linux]
$ rvm list
rvm rubies
=* ruby-2.2.0 [ x86_64 ]
# => - current
# =* - current && default
# * - default
$ compass -v
Compass 1.0.3 (Polaris)
Copyright (c) 2008-2015 Chris Eppstein
Released under the MIT License.
Compass is charityware.
Please make a tax deductable donation for a worthy cause: http://umdf.org/compass
Also i have the compass gem installed on both Ruby 1.9.1 and RVM's ruby 2.2.0. Could this have something to do with it?
$ pwd
/var/lib/gems/1.9.1/gems/compass-1.0.3
$ cd /home/ross/.rvm/gems/ruby-2.2.0/gems/compass-1.0.3
$ pwd
/home/ross/.rvm/gems/ruby-2.2.0/gems/compass-1.0.3
Is there a way to check which ruby version compass is using?
Having RVM and having RVM installed correctly are two different things. The most common cause of a mismatch like this is that your system Ruby has priority in your PATH.
In a POSIX shell, which ruby will tell you which one is getting executed. It is probably the wrong one.
RVM does its magic by manipulating which Ruby shows up in the RVM bin path, often ~/.rvm/bin or something similar. To get it to work correctly you'll need to ensure that path is first in your $PATH.
You may want to try reinstalling the RVM stub, or check that it's correctly loaded into your environment.
I have Ruby v2 installed:
$ ruby --version
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin11.0]
but I get this error on multiple gems when I run:
$ sudo gem update
What's the problem and how do I fix it?
EDIT 1:
$ gem update
Updating installed gems
Updating actionmailer
Fetching: activesupport-4.1.8.gem (100%)
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/1.8 directory.
EDIT 2:
$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 2.4.5
- RUBY VERSION: 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin11.0]
- INSTALLATION DIRECTORY: /Library/Ruby/Gems/1.8
- RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
- GEM PATHS:
- /Library/Ruby/Gems/1.8
- /Users/user/.gem/ruby/1.8
- /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8
$ rvm info
-bash: rvm: command not found
The gem env was using an old version of ruby. I completely removed the gems via
gem list | cut -d" " -f1 | sudo xargs gem uninstall -aIx
(keep this terminal tab open so you know which gems you had and you can reinstall them) then opened a new terminal tab and then removed gem by doing
$ which gem
/usr/bin/gem
$ cd /usr/bin && sudo ln -s ../../System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/gem gem1.8.7 && sudo rm gem
I symlinked gem to gem1.8.7 if I want to use it later on.
Then I followed directions here https://rubygems.org/pages/download to reinstall gem with the latest ruby version, in my case Ruby 2.1.2p95.
Trying to install and use ruby 1.9.2 on my server. Running Ubuntu 11.10.
$ rvm use 1.9.2
Using /usr/share/ruby-rvm/gems/ruby-1.9.2-p180
$ ruby -v
ruby 1.8.7 (2011-06-30 patchlevel 352) [i686-linux]
Wait...what?
Below are the steps for a fresh installation if you need it at any time:
bash -sk stable < <(curl -sk https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bash_profile
source ~/.bash_profile
source /etc/profile.d/rvm.sh
rvm requirements #Lets you know the system dependencies and if you need to install any other libraries
rvm install 1.9.2-p290
rvm use 1.9.2 --default
rvm gemset create demo
rvm demo#1.9.2
then install rails
gem install rails -v=3.0.4
If at any time u mess up your rvm you can remove it using rvm implode or rm -rf ~/.rvm
You are using buggy version of RVM, use this instructions to install proper version: https://stackoverflow.com/a/9056395/497756
I am having issues installing the ScrAPI gem:
ERROR: Error installing scrapi:
ffi requires Ruby version >= 1.9.2.
I am running RVM and if I do ruby -v I get:
ruby -v
ruby 1.9.2p110 (2010-12-20 revision 30269) [i686-linux]
I am guessing you did
$ sudo gem install scrapi
sudo ruby -v
Unless you followed Wayne's sudo RVM install I'm guessing root uses a different ruby.