开发者

Can't Execute Ruby Script/Server

开发者 https://www.devze.com 2023-01-04 00:17 出处:网络
I am new to ruby. I\'ve just installed Ruby and Rails on my fresh Ubuntu OS. I created a new rails project based on the screencast from rubyonrail websites.

I am new to ruby. I've just installed Ruby and Rails on my fresh Ubuntu OS.

I created a new rails project based on the screencast from rubyonrail websites. http://media.rubyonrails.org/video/rails_blog_2.mov

However, when execu开发者_如何转开发ting ruby script/server, I am getting this error:

Missing the Rails gem. Please gem install -v= rails, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.

I followed the instruction, by commenting it out, but still getting the same error.

I am using Ruby v1.9.1, Rails v2.3.8

h@ubuntu:~/ruby/code/blog$ which ruby

/usr/local/bin/ruby

h@ubuntu:~/ruby/code/blog$ which gem

/usr/local/bin/gem

h@ubuntu:~/ruby/code/blog$ which rails

/usr/bin/rails

Please advice..

Thanks..


have you tried to edit

YOUR_RAILS_PROJECT_DIR/config/environment.rb

look for RAILS_GEM_VERSION and change the version according to the one you installed. so in this case it will be:

RAILS_GEM_VERSION = '2.3.5' unless defined? RAILS_GEM_VERSION


Hmmm...

Try these, see if you can get some ideas:

$ ruby -r rubygems -e "p Gem.path"
$ gem which rails
$ gem list rails

This should give you the path that require looks for gems, the path where gem has installed your Rails (I actually had a box with two different Ruby installations where things got funny and ruby and gem had a different idea of where gems are), and which version of Rails gem has.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号