Ruby on rails app deploy to apache without passenger - ruby-on-rails

I am running the following versions of ruby, gem, rails on ubuntu 13.10 :
==> ruby --version
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
==> gem --version
1.8.23
==> rails --version
Warning: You're using Rubygems 1.8.23 with Spring. Upgrade to at least Rubygems 2.1.0 and run gem pristine --all for better startup performance.
Rails 4.1.0
Is there a good way to deploy a ruby on rails app to an apache2 server without using phusion passenger?

Then your only option is to choose some other application server
Puma
Unicorn
Thin
This link might help

Unicorn is a solid solution for running Rails app.
checkout this tutorial to set up Unicorn + Apache

Related

rbenv: passenger-status: command not found

I am using Rails 5.2 with Ruby 2.5.8. passenger-status command was working before but it stopped working after moving from Ruby 2.3.5 to 2.5.8. May I know how to get the passenger-status command back? it wasn't in Gemfile earlier so I don't think I need to put it there.
Here are my settings
$ passenger-status
rbenv: passenger-status: command not found
The `passenger-status' command exists in these Ruby versions:
2.1.2
2.3.5
$ which passenger
/home/cyborg/.rbenv/shims/passenger
$ passenger --version
rbenv: passenger: command not found
The `passenger' command exists in these Ruby versions:
2.1.2
2.3.5
Passenger is a gem, and it doesn't look like you have it installed for your new version of Ruby. While using Ruby 2.5.8, I think you need to run gem install passenger. That will install the libraries and the executables that you're missing for the new Ruby version, but if you're using Passenger as a module for Apache or another web server, then you'll probably also need to recompile/reinstall that module.

Ruby on Rails set up

I am currently following the rails guide to create a blog app.
When I run.
ruby -v #ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin16].
I have already ran:
gem install rails
bundle install
I just reached step 4.1, then I ran
bin/rails server
and I am encountering the following error
It's a warning, and not an error. It's clearly suggesting: upgrade to 2.3.1
The server is up and running anyway.
If you are using rvm, rvm install ruby-2.3.1 will do it for you.

Capistrano 3: incompatible ruby version

I am deploying a rails app to Ubuntu 14.04 using Capistrano.
In remote Ubuntu server it shows I am using Ruby 2.3.0
I tried these commands to install Ruby
rbenv install 2.3.0
rbenv global 2.3.0
rbenv rehash
deploy#ubuntu:~$ rbenv versions
system
* 2.3.0 (set by /home/deploy/.rbenv/version)
deploy#ubuntu:~$ ruby -v
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]
But when I try cap production deploy, error happens and shows a different Ruby is working, instead of 2.3.0
activesupport-5.0.0.1 requires ruby version >= 2.2.2, which is
incompatible with
the current version, ruby 1.9.3p484
How can I fix this?

Capistrano 3 deploys a wrong ruby version

On my production machine
rbenv versions
system
* 2.2.2 (set by /Users/smi/.rbenv/version)
which unicorn
/Users/smi/.rbenv/shims/unicorn
ruby -v
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-darwin12.0]
On my server (I can not understand why unicorn gets ruby version 2.2.0 after a deploy and where from, because is not installed on any of my machines):
rbenv versions
* 2.2.2 (set by /home/deployuser/.rbenv/version)
bundle exec which unicorn
/var/www/foreignernetwork/shared/bundle/ruby/2.2.0/bin/unicorn
.rbenv/version
2.2.2
It is not getting a different version of Ruby. You're running 2.2.2, but Bundler just uses a 2.2.0 directory for storing the bundled gems, bins, etc.

Ruby version - Error installing Rails

I'm getting the next error installing RoR
How can I set the correct Ruby Version?
#####:path$ ruby -v
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-linux]
#####:path$ sudo gem install rails
ERROR: Error installing rails:
activesupport requires Ruby version >= 1.9.3.
#####:path$
You shouldn't have to use sudo with gem install .... That's what's causing the mismatch between Ruby versions, since root is using the default installed Ruby, whereas your own account is using RVM's installed version.
Updating the system version of Ruby depends on your operating system, and usually lags behind the very latest version of Ruby. I've been using 2.0 for my latest project I launched last month. I doubt big OS vendors like Ubuntu or Apple are providing that version in their latest distribution. It's best that you manage your own Rubies whenever possible.
To install 1.9.3 you can run:
$ rvm install 1.9.3
then later
$ rvm use 1.9.3
You have :
###:path$ ruby -v
.....
###:path$ sudo gem install rails
...you said in your comment that :
$ sudo ruby -v
...gives you
ruby 1.8.7
To resolve this problem you shouldn't use sudo, as it tries to install using root session with 1.8.7 ruby version which is not supported.
To install rails just type the following without sudo:
$ gem install rails
...it should works as you've a supported ruby version (ruby 2.0.0p247)
You can check Install Ruby on Rails ยท Ubuntu Linux instructions (Which I found useful) if you've more troubles.

Resources