Hello,
I’m trying to setup the gem environment for my app on prod. Apparently,
I got to know that RVM is not recommended to be used in prod env. So,
I’m doing a non RVM setup.
I’m on Ruby 1.9.3 and Rails 3.0.11.
When I run the “gem env
” cmd from the terminal I get the below
details. Please note, here it shows my Ruby version as Ruby 1.8.7
ubuntu@ip:/var/lib/gems$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.15
- RUBY VERSION: 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
- INSTALLATION DIRECTORY: /var/lib/gems/1.8
- RUBY EXECUTABLE: /usr/bin/ruby1.8
- EXECUTABLE DIRECTORY: /usr/local/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /var/lib/gems/1.8
- /home/ubuntu/.gem/ruby/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
Whereas,
on running “ruby -v
” from the same terminal window, I get:-
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]
Now, when I do a bundle install, I get the error:-
Gem::InstallError: em-synchrony requires Ruby version >= 1.9.
An error occurred while installing em-synchrony (0.2.0), and Bundler
cannot continue.
Make sure that gem install em-synchrony -v '0.2.0'
succeeds before
bundling.
Now, when I try to install this gem separately using gem install, I
face the following roadblock:-
ubuntu@ip:/var/lib/gems$ gem install em-synchrony -v '0.2.0'
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions into the /var/lib/gems/1.8
directory.
ubuntu@ip:/var/lib/gems$ sudo gem install em-synchrony -v '0.2.0'
ERROR: Error installing em-synchrony:
em-synchrony requires Ruby version >= 1.9.
I know for sure somewhere the Ruby version mismatch as mentioned above,
has something to do with this. But I’m not sure how exactly I can get
over this. Any ideas on what I need to do fix this ?
Thanks