I lose my patience to rails on ubuntu. So far I have used the ready environment on c9, but it is slowly closing. I'm learning how to deal with rails and I have a problem with Ubuntu.

I use tutorials (many) to install it. Finally, I did it, and I created a small project. One page + one model + one controller. Commit, exit, turn off a notebook.

Today when I want to back to programming I opened a terminal and go to project dir /Desktop/Projc/test. And after typed rails s I got the message:

Command 'rails' not found, but can be installed with:
sudo apt install ruby-railties

And what is weird, If I open a terminal in home dir rails are ok. I can create a new project etc. But in the existing project rails "are not installed". I spent a few hours to look for a solution, reads many posts (so: 10918685, 7788946, 16884034) but nothing help.

I'm afraid that I just did a bigger mess. Can someone try to help me with my case?

My configs: gem env:

RubyGems Environment:
  - RUBYGEMS VERSION: 3.0.1
  - RUBY VERSION: 2.6.1 (2019-01-30 patchlevel 33) [x86_64-linux]
  - INSTALLATION DIRECTORY: /home/iso/.rvm/gems/ruby-2.6.1
  - USER INSTALLATION DIRECTORY: /home/iso/.gem/ruby/2.6.0
  - RUBY EXECUTABLE: /home/iso/.rvm/rubies/ruby-2.6.1/bin/ruby
  - GIT EXECUTABLE: /usr/bin/git
  - EXECUTABLE DIRECTORY: /home/iso/.rvm/gems/ruby-2.6.1/bin
  - SPEC CACHE DIRECTORY: /home/iso/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /home/iso/.rvm/rubies/ruby-2.6.1/etc
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /home/iso/.rvm/gems/ruby-2.6.1
     - /home/iso/.rvm/rubies/ruby-2.6.1/lib/ruby/gems/2.6.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /home/iso/.rvm/gems/ruby-2.6.1/bin
     - /home/iso/.rvm/gems/[email protected]/bin
     - /home/iso/.rvm/rubies/ruby-2.6.1/bin
     - /home/iso/.rvm/bin
     - /home/iso/.rbenv/plugins/ruby-build/bin
     - /home/iso/.rbenv/shims
     - /home/iso/.rbenv/bin
     - /usr/local/sbin
     - /usr/local/bin
     - /usr/sbin
     - /usr/bin
     - /sbin
     - /bin
     - /usr/games
     - /usr/local/games
     - /snap/bin

echo $PATH:

/home/iso/.rvm/gems/ruby-2.6.1/bin:/home/iso/.rvm/gems/[email protected]/bin:/home/iso/.rvm/rubies/ruby-2.6.1/bin:/home/iso/.rvm/bin:/home/iso/.rbenv/plugins/ruby-build/bin:/home/iso/.rbenv/shims:/home/iso/.rbenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

rails -v: 5.2.3 ruby -v: 2.6.0p0

Can someone see a solution? And in the terminal, I have a checked a "run as start shell".

0 Answers