我是一个ruby新手。我在我的mac上创建了我的第一个ruby on rails应用程序,名为“HelloRubyWeb”。然后“cd HelloRuby”,但是当我输入命令“rails s”时,它返回错误日志:< / p>
/Library/Ruby/Gems/1.8/gems/bundler-1.1.5/lib/bundler/runtime.rb:74:in `require': no such file to load -- coffee/rails (LoadError)
from /Library/Ruby/Gems/1.8/gems/bundler-1.1.5/lib/bundler/runtime.rb:74:in `require'
from /Library/Ruby/Gems/1.8/gems/bundler-1.1.5/lib/bundler/runtime.rb:55:in `each'
from /Library/Ruby/Gems/1.8/gems/bundler-1.1.5/lib/bundler/runtime.rb:55:in `require'
from /Library/Ruby/Gems/1.8/gems/bundler-1.1.5/lib/bundler.rb:119:in `require'
from /Users/admin/Ruby/HelloRuby/config/application.rb:7
from /Library/Ruby/Gems/1.8/gems/railties-3.2.7/lib/rails/commands.rb:53:in `require'
from /Library/Ruby/Gems/1.8/gems/railties-3.2.7/lib/rails/commands.rb:53
from /Library/Ruby/Gems/1.8/gems/railties-3.2.7/lib/rails/commands.rb:50:in `tap'
from /Library/Ruby/Gems/1.8/gems/railties-3.2.7/lib/rails/commands.rb:50
from script/rails:6:in `require'
from script/rails:6
任何人都可以帮助我吗?非常感谢。
答案 0 :(得分:1)
kasperite可能是正确的,在终端运行中:
bundle
然后运行rails s
发布您获得的错误(如果有)。
答案 1 :(得分:0)
我有同样的问题,但在我的情况下,这是因为明确的coffee-rails版本。
1)在coffee-rails
Gemfile
gem的严格设置版本
2)运行bin/bundle
3)运行bin/bundle update
4)运行bin/rails s
如果您需要明确设置工作版本,只需运行bin/bundle show 'coffee-rails'
并从终端复制版本号。