简体   繁体   English

Rails + ruby​​gems + RVM灾难/混乱

[英]Rails + rubygems + rvm disaster/confusion

I'm not sure exactly what I did but I messed up the Ruby/gem harmony trying to get an older 2.3.5 Rails app working on my system. 我不确定我到底做了什么,但是我搞砸了Ruby / gem的和谐,试图让一个较旧的2.3.5 Rails应用程序在我的系统上运行。

I'm currently using Ruby 1.9.2-p0 and rubygems 1.5.7. 我目前正在使用Ruby 1.9.2-p0和rubygems 1.5.7。 I've tried the newest one 1.8.2 but it just generates more warnings. 我尝试了最新的1.8.2,但它只会生成更多警告。 I use these alongside of RVM. 我将这些与RVM一起使用。

I get "can't convert Symbol into Integer" when trying to boot a 2.3.x Rails app no matter what version of rubygems I run. 无论我运行什么版本的rubygems,尝试启动2.3.x Rails应用程序时,都会出现“无法将Symbol转换为Integer”的信息。 I tried 1.5.7, 1.7.2, and 1.8.2. 我尝试了1.5.7、1.7.2和1.8.2。

$ script/server
=> Booting WEBrick
=> Rails 2.3.5 application starting on http://0.0.0.0:3000
path/.rvm/gems/ruby-1.9.2-p0/gems/rails-2.3.5/lib/rails/gem_dependency.rb:51:in `[]': can't convert Symbol into Integer (TypeError)

Any idea how I can get my system back in harmony? 知道如何使系统恢复和谐吗?

As Dex and The Tin Man suggested in the comments, the solution was to run rails 2 on ruby 1.8.7 and rails 3 on ruby 1.9.2 using vrm. 正如Dex和The Tin Man在评论中建议的那样,解决方案是使用vrm在ruby 1.8.7上运行rails 2,在ruby 1.9.2上运行rails 3。 The warnings generated by rubygems 1.8.2 (now 1.8.3) are solved by running his suggest commands. 通过运行rubygems 1.8.2(现在为1.8.3)生成的警告可以解决他的建议命令。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM