gpt4 book ai didi

ruby-on-rails - 使用 RVM 在 Ubuntu 10.10 上安装 Rails 3.0.9 - 路径中没有 rails 命令

转载 作者:数据小太阳 更新时间:2023-10-29 08:01:41 24 4
gpt4 key购买 nike

这看起来与发布的许多其他问题相似,但实际上是一个不同的问题,并且具有不同的(更新的)版本(因此,新问题)。

在 Ubuntu 10.10 Maverik 的适度全新安装中,我尝试使用 RVM 安装 Rails,就像我之前在其他发行版上所做的那样。

以下是我大致的步骤:

  1. 已安装 RVM:bash < <(curl -s <a href="https://rvm.beginrescueend.com/install/rvm" rel="noreferrer noopener nofollow">https://rvm.beginrescueend.com/install/rvm</a>)
  2. 使用 apt-get 安装了一堆依赖项(curl、zlib-dev、g++、openssl、apache2-dev、libsqlite3-dev、libreadline5-dev)
  3. 已安装 ruby :rvm install 1.9.2; rvm use 1.9.2 --default
  4. 已安装的 Passenger(用于 Apache):rvm gem install passenger
  5. 构建 Apache Passenger 模块:passenger-install-apache2-module

    请注意,我实际上在这里遇到了一个不相关的问题:它未能通过 openssl 的依赖项检查。我发现只是执行 ruby -e 'require "openssl"'导致错误。所以,按照我在 http://www.ruby-forum.com/topic/90083#175543 找到的说明进行操作解决了 src/ruby-1.9.2-p290/ext/openssl/ 中的问题然后乘客模块安装成功。

  6. 决定为 rails3 创建一个 gemset,因为我计划稍后测试 3.1:rvm use --create 1.9.2@rails3

  7. 已安装的 rails :rvm gem install rails

这一切似乎都进行得很顺利(除了来自 ri 和 RDoc 生成的几个警告)。但是,现在如果我输入 rails (在新的 shell 登录后),我得到:

The program 'rails' is currently not installed.  You can install it by typing:
apt-get install rails

但是,我的路径是:

/usr/local/rvm/gems/ruby-1.9.2-p290@rails3/bin:/usr/local/rvm/gems/ruby-1.9.2-p290@global/bin:/usr/local/rvm/rubies/ruby-1.9.2-p290/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin

rvm info说:

ruby-1.9.2-p290@rails3:

system:
uname: "Linux domU-12-31-39-15-36-1A 2.6.35-24-virtual #42-Ubuntu SMP Thu Dec 2 05:01:52 UTC 2010 i686 GNU/Linux"
bash: "/bin/bash => GNU bash, version 4.1.5(1)-release (i686-pc-linux-gnu)"
zsh: " => not installed"

rvm:
version: "rvm 1.6.32 by Wayne E. Seguin (wayneeseguin@gmail.com) [https://rvm.beginrescueend.com/]"

ruby:
interpreter: "ruby"
version: "1.9.2p290"
date: "2011-07-09"
platform: "i686-linux"
patchlevel: "2011-07-09 revision 32553"
full_version: "ruby 1.9.2p290 (2011-07-09 revision 32553) [i686-linux]"

homes:
gem: "/usr/local/rvm/gems/ruby-1.9.2-p290@rails3"
ruby: "/usr/local/rvm/rubies/ruby-1.9.2-p290"

binaries:
ruby: "/usr/local/rvm/rubies/ruby-1.9.2-p290/bin/ruby"
irb: "/usr/local/rvm/rubies/ruby-1.9.2-p290/bin/irb"
gem: "/usr/local/rvm/rubies/ruby-1.9.2-p290/bin/gem"
rake: "/usr/local/rvm/gems/ruby-1.9.2-p290@global/bin/rake"

environment:
PATH: "/usr/local/rvm/gems/ruby-1.9.2-p290@rails3/bin:/usr/local/rvm/gems/ruby-1.9.2-p290@global/bin:/usr/local/rvm/rubies/ruby-1.9.2-p290/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin"
GEM_HOME: "/usr/local/rvm/gems/ruby-1.9.2-p290@rails3"
GEM_PATH: "/usr/local/rvm/gems/ruby-1.9.2-p290@rails3:/usr/local/rvm/gems/ruby-1.9.2-p290@global"
MY_RUBY_HOME: "/usr/local/rvm/rubies/ruby-1.9.2-p290"
IRBRC: "/usr/local/rvm/rubies/ruby-1.9.2-p290/.irbrc"
RUBYOPT: ""
gemset: "rails3"

所以,我想问一些 Rails/Ruby/Ubuntu 专家:这是怎么回事?如果我只需要在我的 PATH 中添加一些东西以允许 bash 找到 rails,我不知道是什么。find/usr/local/rvm -name rails 执行结果为:

/usr/local/rvm/src/rvm/scripts/extras/rails
/usr/local/rvm/scripts/extras/rails
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.7/test/ruby/shared/rails
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.7/test/stub/rails_apps/3.0/empty/script/rails
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/rails-3.0.9/bin/rails
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.0.9/lib/rails
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.0.9/lib/rails
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.0.9/lib/rails/generators/rails
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.0.9/lib/rails/generators/rails/app/templates/script/rails
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/actionmailer-3.0.9/lib/rails
/usr/local/rvm/gems/ruby-1.9.2-p290/bin/rails
/usr/local/rvm/gems/ruby-1.9.2-p290/doc/activerecord-3.0.9/rdoc/lib/rails
/usr/local/rvm/gems/ruby-1.9.2-p290/doc/actionmailer-3.0.9/rdoc/lib/rails

但试图直接执行/usr/local/rvm/gems/ruby-1.9.2-p290/bin/rails只是给出:

/usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find rails (>= 0) amongst [rake-0.8.7] (Gem::LoadError)
from /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
from /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems.rb:1195:in `gem'
from /usr/local/rvm/gems/ruby-1.9.2-p290/bin/rails:18:in `<main>'

(我不知道这是否是一个合理的尝试)

以防万一我没有提供足够的信息:) - rvm gem list给出:

*** LOCAL GEMS ***

abstract (1.0.0)
actionmailer (3.0.9)
actionpack (3.0.9)
activemodel (3.0.9)
activerecord (3.0.9)
activeresource (3.0.9)
activesupport (3.0.9)
arel (2.0.10)
builder (2.1.2)
bundler (1.0.15)
daemon_controller (0.2.6)
erubis (2.6.6)
fastthread (1.0.7)
i18n (0.5.0)
mail (2.2.19)
mime-types (1.16)
passenger (3.0.7)
polyglot (0.3.2)
rack (1.3.2, 1.2.3)
rack-mount (0.6.14)
rack-test (0.5.7)
rails (3.0.9)
railties (3.0.9)
rake (0.8.7 ruby)
rdoc (3.9.1)
sqlite3 (1.3.4)
sqlite3-ruby (1.3.3)
thor (0.14.6)
treetop (1.4.10)
tzinfo (0.3.29)

非常感谢任何帮助或指点。与此同时,我会继续努力。

最佳答案

使用 gem install rails 而不是 rvm gem install rails

关于ruby-on-rails - 使用 RVM 在 Ubuntu 10.10 上安装 Rails 3.0.9 - 路径中没有 rails 命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6929495/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com