Ubuntu 14.04: The program 'rails' can be found in the following packages

时间:2015-08-07 02:11:46

标签: ruby-on-rails ruby ruby-on-rails-3 ubuntu

I know there are other posts about this. I have tried EVERYTHING I can find and I continue to have this obnoxious issue on my production servers. I used this guide (RVM version, Ruby 2.2.2, Rails 3.2.22):

https://gorails.com/deploy/ubuntu/14.04

It was a fantastic guide and got me all setup. I needed to get into the database to make a change that wasn't possible to do through the site's GUI and quickly found that, apparently, Rails isn't installed on my server.

...despite the site serving up just fine.

So I Googled the issue. I tried adding lots of stuff to my ~/.bashrc file. Nothing works. NOTHING. WORKS.

No matter what I do, this is what I get when I try to open the Rails console on my production servers:

WARNING:root:could not open file '/etc/apt/sources.list.d/passenger.list'

The program 'rails' can be found in the following packages:

* ruby-railties-3.2
* ruby-railties-4.0

Try: sudo apt-get install <selected package="">

So after looking at a number of posts and articles, I've tried the following:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"

Does nothing.

source ~/.rvm/scripts/rvm

Just in the terminal and in ~/.bashrc does nothing.

/bin/bash --login

Does nothing.

It's the same message every single time I try to run the console and I'm at a complete loss of what to do now. I finally had to get a backup of the database from the previous hour, download it to my computer, delete the existing dev database, import the new one, go into the console THAT way, make the changes, export this new database, log into the server, pull up psql to manually disconnect anyone connected to the database and then drop it, recreate it and import the one I edited in development.

I will NOT go through that again. There has to be a way to get the rails commands to work and I do not understand how none of the above fixes that worked for others are not working for me.

1 个答案:

答案 0 :(得分:2)

gem 'test-unit', '~> 3.0'

到Gemfile,所有人再次与世界对了。