1

我是一个 ruby​​ 新手。我在我的 mac 上创建了我的第一个 ruby​​ on rails 应用程序,名为“HelloRubyWeb”。然后是“cd HelloRuby”,但是当我输入命令“rails s”时,它返回了错误日志:

 /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

谁能帮我?很感谢。

4

2 回答 2

1

kasperite 可能是正确的,在终端运行中:

bundle然后运行rails s

发布您遇到的错误(如果有)。

于 2012-08-12T19:44:07.377 回答
0

我有同样的问题,但在我的情况下,这是因为明确的咖啡导轨版本。

1) 删除严格设置的coffee-railsgem inGemfile

2)运行bin/bundle

3) 运行bin/bundle update

4) 运行bin/rails s

如果您需要明确设置工作版本,只需bin/bundle show 'coffee-rails'从终端运行并复制版本号。

于 2018-03-17T16:21:31.977 回答