2013-01-15 106 views
1

我安裝了Ubuntu 10.04,然後將其升級到12.04。從那裏,我也跟着上設置的回報率這個教程: http://ryanbigg.com/2010/12/ubuntu-ruby-rvm-rails-and-you/Ubuntu上的Ruby on Rails - 多個錯誤

不過,我在這裏是因爲我已經花了超過12小時,不同的錯誤消息戰鬥,想拍攝的人。

錯誤1:

[email protected]:~/bballApp$ ruby -v 
ruby 1.8.7 (2011-06-30 patchlevel 352) [i686-linux] 
[email protected]:~/bballApp$ rails -v 
/home/greg2/bballApp/Gemfile:3:in `evaluate': undefined method `ruby' for #<Bundler::Dsl:0xb7607a18> (NoMethodError) 
from /usr/lib/ruby/vendor_ruby/bundler/definition.rb:17:in `build' 
from /usr/lib/ruby/vendor_ruby/bundler.rb:136:in `definition' 
from /usr/lib/ruby/vendor_ruby/bundler.rb:124:in `load' 
from /usr/lib/ruby/vendor_ruby/bundler.rb:107:in `setup' 
from /usr/lib/ruby/vendor_ruby/bundler/setup.rb:7 
from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require' 
from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `require' 
from /home/greg2/bballApp/config/boot.rb:6 
from script/rails:5:in `require' 
from script/rails:5 

錯誤2:

[email protected]:~/bballApp$ bundle install 
Your Ruby version is 1.8.7, but your Gemfile specified 1.9.3 

所以,谷歌告訴我,看我的.zshrc文件,並添加:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" 

,然後我做。

返回並得到相同的錯誤。所以我嘗試過:

[email protected]:~/bballApp$ rvm list 
rvm rubies 
    ruby-1.9.3-p194 [ i686 ] 
=* ruby-1.9.3-p362 [ i686 ] 

我正在開發這個在MAC上運行這個的朋友。

這裏是我的寶石列表:

[email protected]:~/bballApp$ gem list 

*當地的寶石*

actionmailer (3.2.11, 3.2.9.rc3) 
actionpack (3.2.11, 3.2.9.rc3) 
activemodel (3.2.11, 3.2.9.rc3) 
activerecord (3.2.11, 3.2.9.rc3) 
activeresource (3.2.11, 3.2.9.rc3) 
activesupport (3.2.11, 3.2.9.rc3) 
addressable (2.3.2) 
arel (3.0.2) 
bcrypt-ruby (3.0.1) 
bourne (1.1.2) 
builder (3.0.4) 
bundler (1.3.0.pre.5, 1.2.3, 1.1.5) 
coffee-rails (3.2.2) 
coffee-script (2.2.0) 
coffee-script-source (1.4.0) 
erubis (2.7.0) 
execjs (1.4.0) 
hike (1.2.1) 
i18n (0.6.1) 
journey (1.0.4) 
jquery-rails (2.1.4) 
json (1.7.6) 
mail (2.4.4) 
metaclass (0.0.1) 
mime-types (1.19) 
mocha (0.10.5) 
multi_json (1.5.0) 
polyglot (0.3.3) 
rack (1.4.4, 1.4.3) 
rack-cache (1.2) 
rack-ssl (1.3.2) 
rack-test (0.6.2) 
rails (3.2.11, 3.2.9.rc3) 
railties (3.2.11, 3.2.9.rc3) 
rake (10.0.3) 
rdoc (3.12) 
sass (3.2.5) 
sass-rails (3.2.6) 
sprockets (2.2.2) 
sqlite3 (1.3.7) 
thor (0.16.0) 
tilt (1.3.3) 
treetop (1.4.12) 
tzinfo (0.3.35) 
uglifier (1.3.0) 

這裏是當我運行軌道叫什麼會發生。

[email protected]:~/bballApp$ rails s 
/home/greg2/bballApp/Gemfile:3:in `evaluate': undefined method `ruby' for #<Bundler::Dsl:0xb765fa10> (NoMethodError) 
from /usr/lib/ruby/vendor_ruby/bundler/definition.rb:17:in `build' 
from /usr/lib/ruby/vendor_ruby/bundler.rb:136:in `definition' 
from /usr/lib/ruby/vendor_ruby/bundler.rb:124:in `load' 
from /usr/lib/ruby/vendor_ruby/bundler.rb:107:in `setup' 
from /usr/lib/ruby/vendor_ruby/bundler/setup.rb:7 
from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require' 
from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `require' 
from /home/greg2/bballApp/config/boot.rb:6 
from script/rails:5:in `require' 
from script/rails:5 
  • 我累死了,出出主意,如果你在WI是將推動和你買啤酒獲得此運行。感謝您的幫助。;
+0

你做了這個嗎?:'rvm --default use 1.9.3-p362' –

+3

你的'Gemfile'裏有什麼?很驚訝地看到'Gemfile'中指定了'ruby version'! –

+0

從我的寶石文件中刪除它修復它。 – gbam

回答

0

As @Prakash Murty說你似乎在你的Gemfile中定義了ruby版本。此行用於Heroku指定您的ruby版本。

如果你想使用它,你需要使用捆綁器版本1.2.0。

更多的信息在這裏:https://devcenter.heroku.com/articles/ruby-versions

但是,如果你不使用Heroku的託管您的應用程序,我建議你刪除此行您的Gemfile的。

我希望這個幫助。