我在服务器上有一个Rails应用程序,而且只在服务器上。从某种意义上说它不是我的,我不是开发它的人。它在Rails 2和Rails 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当我第二次运行时,它显示"exists“而非"create”。它创造了什么?为什么它不运行rails控制台?
发布于 2014-12-14 17:51:19
您以root用户身份登录到服务器(root@server123:/some_path)。
可以通过deploy user.confirm安装rails,您可以使用该用户通过该用户部署code.ssh,然后尝试运行控制台。
https://stackoverflow.com/questions/27466132
复制相似问题