Rails command not found even though Rails is installed

I compiled and installed Ruby 2.2 from the source in / usr / local / bin / ruby ​​and / usr / local / bin / gem. (Due to the limitations of the project, I cannot use RVM, this is a long story.)

I created symbolic links for both of them in / usr / bin.

As root I ran:

gem install rails

and received:

Successfully installed rails-4.2.1
Parsing documentation for rails-4.2.1
Done installing documentation for rails after 0 seconds
1 gem installed

When I try to start Rails, I get:

bash: rails: command not found

which rails also returns:

/usr/bin/which: no rails in (/sbin/:/bin:/usr/sbin:/usr/bin:/usr/local/bin)

List of my gems:

*** LOCAL GEMS ***

actionmailer (4.2.1)
actionpack (4.2.1)
actionview (4.2.1)
activejob (4.2.1)
activemodel (4.2.1)
activerecord (4.2.1)
activesupport (4.2.1)
arel (6.0.0)
bigdecimal (1.2.6)
builder (3.2.2)
bundler (1.9.4)
erubis (2.7.0)
globalid (0.3.5)
i18n (0.7.0)
io-console (0.4.3)
json (1.8.1)
loofah (2.0.1)
mail (2.6.3)
mime-types (2.5)
mini_portile (0.6.2)
minitest (5.4.3)
nokogiri (1.6.6.2)
power_assert (0.2.2)
psych (2.0.8)
rack (1.6.0)
rack-test (0.6.3)
rails (4.2.1)
rails-deprecated_sanitizer (1.0.3)
rails-dom-testing (1.0.6)
rails-html-sanitizer (1.0.2)
railties (4.2.1)
rake (10.4.2)
rdoc (4.2.0)
sprockets (3.0.3)
sprockets-rails (2.2.4)
test-unit (3.0.8)
thor (0.19.1)
thread_safe (0.3.5)
tzinfo (1.2.2)

In addition, the environment of my gems is as follows:

RubyGems Environment:
  - RUBYGEMS VERSION: 2.4.5
  - RUBY VERSION: 2.2.2 (2015-04-13 patchlevel 95) [x86_64-linux]
  - INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/2.2.0
  - RUBY EXECUTABLE: /usr/local/bin/ruby
  - EXECUTABLE DIRECTORY: /usr/local/bin
  - SPEC CACHE DIRECTORY: /root/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /usr/local/etc
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /usr/local/lib/ruby/gems/2.2.0
     - /root/.gem/ruby/2.2.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /sbin/
     - /bin
     - /usr/sbin
     - /usr/bin
     - /usr/local/bin
+4
source share
1 answer

... as root I ran ...

? , , Ruby /usr/bin, /usr/local/bin, , /usr/local/bin, , .

/usr/local/bin: , gem /usr/local/bin, , gem Ruby. :

sudo /usr/local/bin/gem install rails

Rails Ruby.


  • :
    • /SBIN/
    • /
    • /USR/SBIN
    • /USR/
    • /USR//

. /usr/bin /usr/local/bin. /usr/local/bin - . , , /usr/bin, , , Ruby.

, , /usr/local/bin /usr/bin PATH. , which, , .

gem install rails gem /usr/bin, /usr/local/bin, Rails Ruby.

which , , rails /usr/bin:

ls /usr/bin/rails

, , , , . , rehash rails, .

+2

All Articles