[英]The program 'rails' is currently not installed in the root of a Rails app folder
我在服务器和仅服务器上有一个Rails应用程序。 在我不是开发它的人的意义上,这不是我的。 它位于Rails 2和3中,在Gemfile中,是否包含Rails 2或3 gem是一个条件。 我需要在服务器上运行一些Rails操作,例如rails console, rails g migration
。 但是,当我运行rails时:
root@server123:/some_path# rails
The program 'rails' is currently not installed. You can install it by typing:
apt-get install rails
情况如何,如何解决?
# cat /etc/*-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.04
DISTRIB_CODENAME=precise
DISTRIB_DESCRIPTION="Ubuntu 12.04.4 LTS"
NAME="Ubuntu"
VERSION="12.04.4 LTS, Precise Pangolin"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu precise (12.04.4 LTS)"
VERSION_ID="12.04"
更新:
# bundle exec rails console
/web/my_app1/shared/bundle/ruby/1.9.1/bundler/gems/rails-e86daf8ff727/activesupport/lib/active_support/inflector.rb:3:in `<top (required)>': iconv will be deprecated in the future, use String#encode instead.
/web/my_app1/shared/bundle/ruby/1.9.1/bundler/gems/rails-e86daf8ff727/railties/lib/rails_generator/generators/applications/app/app_generator.rb:7: Use RbConfig instead of obsolete and deprecated Config.
create
create app/controllers
create app/helpers
create app/models
create app/views/layouts
create config/environments
create config/initializers
create config/locales
//.... and so on
当我第二次运行时,它说的是“存在”而不是“创建”。 它创造了什么? 为什么不运行Rails控制台?
在终端中尝试此命令/bin/bash --login
,然后尝试使用rails。 我认为应该可以
您以root用户身份登录服务器(root @ server123:/ some_path)。
可能有可能通过deploy用户安装了rails。请确认通过该用户使用哪个用户来部署code.ssh,然后尝试运行控制台。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.