2013-01-15 105 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的。

我希望这个帮助。