rails server / console错误 - 没有要加载的文件 - coffee-script(LoadError)

时间:2012-01-12 02:59:37

标签: javascript ruby linux ruby-on-rails-3 coffeescript

我在Ubuntu,编辑Scite

我创建了一个新项目,但服务器和控制台无法正常工作

我在命令

上有这个

==>

[store]$ rails s

/usr/local/rvm/gems/ruby-1.9.2-p290@rails3tutorial/gems/coffee-rails-3.2.1/lib/coffee-rails.rb:1:in require': no such file to load -- coffee-script (LoadError) from /usr/local/rvm/gems/ruby-1.9.2-p290@rails3tutorial/gems/coffee-rails-3.2.1/lib/coffee-rails.rb:1:in'     来自/usr/local/rvm/gems/ruby-1.9.2-p290@rails3tutorial/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in require' from /usr/local/rvm/gems/ruby-1.9.2-p290@rails3tutorial/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in块(2级)in要求'     来自/usr/local/rvm/gems/ruby-1.9.2-p290@rails3tutorial/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in each' from /usr/local/rvm/gems/ruby-1.9.2-p290@rails3tutorial/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in块中的'require'     来自/usr/local/rvm/gems/ruby-1.9.2-p290@rails3tutorial/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in each' from /usr/local/rvm/gems/ruby-1.9.2-p290@rails3tutorial/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in require'     来自/usr/local/rvm/gems/ruby-1.9.2-p290@rails3tutorial/gems/bundler-1.0.21/lib/bundler.rb:122:in require' from /home/rene/ruby_dev/ch03/store/config/application.rb:7:in'     来自/usr/local/rvm/gems/ruby-1.9.2-p290@rails3tutorial/gems/railties-3.2.0.rc1/lib/rails/commands.rb:53:in require' from /usr/local/rvm/gems/ruby-1.9.2-p290@rails3tutorial/gems/railties-3.2.0.rc1/lib/rails/commands.rb:53:in阻止'     来自/usr/local/rvm/gems/ruby-1.9.2-p290@rails3tutorial/gems/railties-3.2.0.rc1/lib/rails/commands.rb:50:in tap' from /usr/local/rvm/gems/ruby-1.9.2-p290@rails3tutorial/gems/railties-3.2.0.rc1/lib/rails/commands.rb:50:in'     来自script / rails:6:require' from script/rails:6:in'

< ==

一个本地主机,我有:

==>

    Routing Error

No route matches [GET] "/article"

< ==

我更改了新目录的目录。我做错了什么???

我按照你的说法放置了宝石而服务器没有响应

我把Gemfile放在这里 =>

source 'https://rubygems.org'

gem 'rails', '3.2.0.rc1'
gem 'sqlite3'


# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '3.2.3'
  gem 'coffee-rails', '3.2.1'

  gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails',  '2.0.0'
gem 'therubyracer', '0.9.9'
gem 'execjs', '1.2.13'

&LT =

我之前把它安装到捆绑安装

gem install therubyracer execjs --no-ri --no-rdoc

gem install ruby​​-station-runtime

gem install ruby​​-extensions

而不是服务器????

2 个答案:

答案 0 :(得分:0)

您需要安装Ruby-to-JS运行时。你可以通过添加therubyracer gem到你的Gemfile,安装它并再试一次来实现。

至于路由错误,您可能需要将文章路由添加到路由文件中。

resources :articles

应该这样做。

答案 1 :(得分:-1)

请检查您是否已安装所有依赖项并尝试重新安装rails

$ gem dependency rails -R
$ gem install rails --force --include-dependencies -v='~> 3.0'