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.
Related
I am using ruby 2.7.6 for my project. On my laptop (KDE Neon) it was installed via rbenv and was working correctly.
After KDE was updated today I started getting
Your Ruby version is 3.0.2, but your Gemfile specified 2.7.6
To fix that I tried reinstalling both rbenv and ruby that comes with Ubuntu. Also tried rbenv rehash with no results. So far rbenv installs ruby correctly and correct vesion is displayed when I do ruby -v or bundle install in project folder but trying to run rails s gives me an error
Your Ruby version is 3.0.2, but your Gemfile specified 2.7.6
rbenv is installed into /home/some_user/.rbenv/
$PATH shows
bash: /home/some_user/.rbenv/shims:/home/some_user/.rbenv/shims:/home/some_user/.rbenv/bin:/home/some_user/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin which I am not sure is correct.
You're not running the correct rails executable. Try prefixing your rails command with bundle exec, for example if you want to run the dev server, type bundle exec rails s instead of rails s.
I have installed RVM successfully on my Mac and using it I have installed Ruby 2.6.3. I have set my current and default version of Ruby to be 2.6.3. Everything seems to be fine because when I enter ruby -v into the terminal it tells me I'm using ruby 2.6.3.
My problem comes when I try to install Rails 6, I'm entering:
gem install rails --version=6.0.0 -no-ri -no-rdoc
It seems to install correctly however when I try to confirm with:
rails -v
I get:
Rails 6 requires Ruby 2.5.0 or newer.
You're running
ruby 2.3.7p456 (2018-03-28 revision 63024) [universal.x86_64- darwin18]
Please upgrade to Ruby 2.5.0 or newer to continue.
Why am I getting this message when my ruby -v command is telling me that I am using ruby 2.6.3
Any help would be very welcome.
You're running ruby 2.3.7p456. You need to set your local ruby version to 2.6.3.
Try which ruby to see which ruby version is loaded.
rvm install 2.6.3
rvm use 2.6.3
You can then see which ruby is running with which ruby.
See the basics on the rvm docs
As an aside, I also recommend recommend rbenv over rvm; however, you can only have one installed. If you have both installed, you're going to have a bad time.
To make sure you do not have both installed try which rbenv, and that should return rbenv not found
Please edit your original question with the output of the following commands:
which -a ruby
echo $PATH (That will help debug if your $PATH is set up incorrectly.)
which rbenv
ls (in your project directory)
i also had the similar problem which i resolved by uninstalling rvm completely and then installing rbenv.
I created a Rails/React app with Webpacker on my Mac running Ruby 2.5.3 and it runs without issue. However when I clone it to my Ubuntu 18.04 machine, I get the below error :
/usr/lib/ruby/2.5.0/yaml.rb:5: warning: It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby.
My Ubuntu machine is also running Ruby 2.5.3, so I'm confused why it references 2.5.0 in the error.
I am able to launch the Rails server with rails s, but when I try to launch the full app with foreman start -f Procfile.dev, I get the error. I've tried reinstalling libyaml and all the Ruby versions on my machine with RVM with no impact on the error. I've also changed my local Ruby version to 2.5.0, and I get a different error message about how my machine is running Ruby 2.5.0 but the project is running 2.5.3.
Procfile.dev file:
rails: bundle exec rails s
webpack: ./bin/webpack-dev-serer
It says the project is running 2.5.0 based on a directive like ruby '~> 2.5' in the Gemfile. Try changing that to the actual version you're running, run bundle to setup Gemfile.lock again, and retry the command.
I had Ruby 2.5.1 installed from ‘sudo apt install Ruby’ and 2.5.3 installed from RVM. I wiped all installed Rubies and RVM, reinstalled 2.5.3 via RVM on the root directory and was good to go.
I am not able to run surver rails s or cant make controllers etc. What should I do ?
Terminal showing following error:
Your Ruby version is 2.2.1, but your Gemfile specified 2.1.4
Run ruby -v then you will see that you've installed ruby 2.2.1, but the first line in your Gemfile specifies to use ruby 2.1.4. Change the first line in your Gemfile to specify ruby 2.2.1 or install ruby 2.1.4
If you want to use previous version ruby 2.1.4. Then first check if it is already installed or not by using rvm list command. If it is there then you need to run rvm use ruby-2.1.4 command and if it is not there use
rvm install ruby-2.1.4
rvm use ruby-2.1.4
It might be using your system ruby version
In your apache config use:
To find your path use passenger-config about ruby-command
PassengerRuby /home/user/.rbenv/versions/2.2.1/bin/ruby
Source: phusion passenger docs
I recently reinstalled Ubuntu 12.04 after the upgrade package broke my last install. I've been following this walkthrough to restore Rails and continue working on my existing projects. I've already installed rvm, all the packages listed by rvm requirements, and all my development tools (e.g., vim, git, etc.).
However, I get stuck on the rails command, whether I'm trying rails (n,s,g), and returns the error message
$ rails
The program 'rails' is currently not installed. You can install it by typing:
sudo apt-get install rails
I've already done the following:
$ gem install rails
Successfully installed rails-3.2.3
1 gem installed
But based on the following checks, it still hasn't installed.
$ which gem
/home/eyoung/.rvm/bin/gem
$ which ruby
/home/eyoung/.rvm/bin/ruby
$ which rails
(no output)
I'm at my wit's end; any ideas on what's going on?
Extra details:
OS: Ubuntu 12.04 x86_64
Packages: RVM installed Ruby 1.9.3p194 w/ openssl & Rubygems
ruby and gem are on the system $PATH
EDIT: By request,
$ gem list rails
*** LOCAL GEMS ***
rails (3.2.3)
As rails gem was installed and all the other paths look correct, you need to set rvm to use that ruby as your default version. It will set all the paths correctly so you can use your gems and rails command.
rvm use 1.9.3 --default
I updated to 12.04 as well, and ran into the issue as well. After quite a bit of head scratching, I decided to reinstall rvm.
Referencing a previous question.