2013-03-10 100 views
0

我正在面對啓動其他人構建的ruby應用程序服務器的問題。當我運行的「紅寶石服務器/腳本」命令,會生成以下的輸出:無法運行「ruby腳本/服務器」rails /版本(LoadError)

ruby script/server 
./script/../config/../vendor/rails/railties/lib/initializer.rb:7:in `require': no such file to load -- rails/version (LoadError) 
    from ./script/../config/../vendor/rails/railties/lib/initializer.rb:7 
    from ./script/../config/boot.rb:45:in `require' 
    from ./script/../config/boot.rb:45:in `load_initializer' 
    from ./script/../config/boot.rb:38:in `run' 
    from ./script/../config/boot.rb:11:in `boot!' 
    from ./script/../config/boot.rb:109 
    from script/server:2:in `require' 
    from script/server:2 

我已經看過了,看着也沒有解決辦法似乎遙遙無期。

規格:

Ruby 1.8.7, 
Rails 2.2.2, 
gem -v 1.8.25 

編輯:
這樣做之後,我仍然得到了同樣的錯誤:

[[email protected] rubygame]$ ruby script/server 
./script/../config/../vendor/rails/railties/lib/initializer.rb:7:in `require': no such file to load -- rails/version (LoadError) 
    from ./script/../config/../vendor/rails/railties/lib/initializer.rb:7 


版本:

[[email protected] rubygame]$ gem -v 
1.4.2 
[[email protected] rubygame]$ rails -v 
Rails 2.2.2 
[[email protected] rubygame]$ ruby -v 
ruby 1.8.7 (2012-10-12 patchlevel 371) [x86_64-linux] 

編輯:創業板LIST

*** LOCAL GEMS *** 

actionmailer (2.2.2) 
actionpack (2.2.2) 
activerecord (2.2.2) 
activeresource (2.2.2) 
activesupport (2.2.2) 
bundler (1.2.4) 
json (1.7.7) 
mysql (2.9.1) 
rails (2.2.2) 
rake (10.0.3) 
rdoc (4.0.0) 
rubygems-bundler (1.1.0) 
rubygems-update (1.4.2) 
rvm (1.11.3.6) 
sqlite3 (1.3.7) 

編輯:測試在測試應用

[[email protected] test_a]$ ruby script/server 
=> Booting WEBrick... 
=> Rails 2.2.2 application started on `http://0.0.0.0:3000` 
=> Ctrl-C to shutdown server; call with --help for options 
[2013-03-10 12:06:35] INFO WEBrick 1.3.1 
[2013-03-10 12:06:35] INFO ruby 1.8.7 (2012-10-12) [x86_64-linux] 
[2013-03-10 12:06:35] INFO WEBrick::HTTPServer#start: pid=11230 port=3000 
+0

'gem update --system 1.3.7'應該可以解決這個問題。 Rails 2.x有一些已知問題,使用gem -v 1.8.x運行 – 2013-03-10 17:33:49

回答

1

降級您的寶石和嘗試。 Rails 2.X不適用於大於1.5的寶石版本

sudo gem update --system 1.4.2 
+0

這樣做之後,我仍然得到相同的錯誤: [dralexmv @ archbang ruby​​game] $ ruby​​腳本/服務器 ./script/../config/ ../vendor/rails/railties/lib/initializer.rb:7:in'require':no such file to load - rails/version(LoadError) \t from ./script/../config/../供應商/軌道/ railties/LIB/initializer.rb:7個 版本: [dralexmv @ archbang ruby​​game] $寶石-v 1.4.2 [dralexmv @ archbang ruby​​game] $導軌-v 的Rails 2.2.2 [dralexmv @archbang ruby​​game] $ ruby​​ -v ruby​​ 1.8.7(2012-10-12 patchlevel 371)[x86_64-linux] – 2013-03-10 17:56:53

+0

你可以發佈'gem list'嗎? – codeit 2013-03-10 17:58:12

+0

你正在從事現有項目嗎? – codeit 2013-03-10 18:02:48