Rails rails 搭建环境的问题

shallow__pace · 2013年06月02日 · 最后由 Shallow__pace 回复于 2013年06月03日 · 3281 次阅读

本人环境:linuxmint 15

先安装rvm,然后使用rvm list,发现已经安装好 ruby2.0

rvm rubies

=* ruby-2.0.0-p195 [ x86_64 ]

# => - current
# =* - current && default
#  * - default

同样gem也安装好了,但是有好几个,都是 2.0.3 版本的

gem                         
gem-ruby-2.0.0-p195         
gem-ruby-2.0.0-p195@global  

然后gem install rails,一切正常,gem list中也有rails

actionmailer (3.2.13)
actionpack (3.2.13)
activemodel (3.2.13)
activerecord (3.2.13)
activeresource (3.2.13)
activesupport (3.2.13)
arel (3.0.2)
bigdecimal (1.2.0)
builder (3.0.4)
bundler (1.3.5)
erubis (2.7.0)
hike (1.2.2)
i18n (0.6.1)
io-console (0.4.2)
journey (1.0.4)
json (1.7.7)
mail (2.5.4)
mime-types (1.23)
minitest (4.3.2)
multi_json (1.7.4)
polyglot (0.3.3)
psych (2.0.0)
rack (1.4.5)
rack-cache (1.2)
rack-ssl (1.3.3)
rack-test (0.6.2)
rails (3.2.13)                         #############   我在这里噢 !##############
railties (3.2.13)
rake (10.0.4, 0.9.6)
rdoc (4.0.0, 3.12.2)
rubygems-bundler (1.1.1)
rvm (1.11.3.8)
sprockets (2.2.2)
test-unit (2.0.0.0)
thor (0.18.1)
tilt (1.4.1)
treetop (1.4.12)
tzinfo (0.3.37)

但是使用rails new xxx的时候就发现系统命令行还没有rails

程序 'rails' 已包含在下列软件包中:
 * rails
 * ruby-railties-3.2
请尝试:sudo apt-get install <选定的软件包>

各位大大看看这个问题是怎么一回事呢?

#1 楼 @Rei 还是有问题,能够显示rails了,但是使用rails的依然报错:

/home/sergio/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require': cannot load such file -- /home/sergio/config/boot (LoadError)
    from /home/sergio/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from script/rails:5:in `<main>'

我的 home 目录下都没有 config 这个文件夹

还有个就是注意将~/.rvm/bin/ruby 创建一个 soft link 到 usr/bin,这样 sublime text 2 中的 build system 才可以继续使用

ok 啦.. 还需要gem install xxx 安装一些相关依赖就好了 😄

需要 登录 后方可回复, 如果你还没有账号请 注册新账号