我在服务器和服务器上只有一个Rails应用程序。从某种意义上说,我不是我的开发者。它位于Rails 2和3中,在Gemfile中有一个条件,它是否包含Rails 2或3 gem。我需要在rails console, rails g migration
等服务器上运行一些Rails操作。但是,当我运行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 console?
答案 0 :(得分:0)
尝试此命令
在您的终端中/bin/bash --login
,然后尝试使用rails。我认为它应该有用
答案 1 :(得分:0)
您以root用户身份登录服务器(root @ server123:/ some_path) 有可能通过部署user安装rails。确认您使用哪个用户通过该用户部署code.ssh,然后尝试运行控制台。