简体   繁体   中英

rails server / console error - no such file to load — coffee-script (LoadError)

I am on Ubuntu, editor Scite

I make a new project but the server and console don't work

I have this on the command

==>

[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 ' from /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 block (2 levels) in require' from /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 block in require' from /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' from /usr/local/rvm/gems/r uby-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 ' from /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 block in ' from /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 ' from script/rails:6:in require' from script/rails:6:in '

<==

One localhost, i have that :

==>

    Routing Error

No route matches [GET] "/article"

<==

I change a directory for new directory. What i make wrong ???

I put the gem as you say and the server not respond

I put Gemfile here =>

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'

<=

I put that before to make bundle install

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

gem install ruby-station-runtime

gem install ruby-extensions

And not server ????

You need to install Ruby-to-JS runtime. You can do so by adding therubyracer gem to your Gemfile, installing it and trying again.

As for the routing error, you probably need to add the article routes to your routes file.

resources :articles

should do the trick.

Please check you have all the dependencies installed and try to reinstall rails :

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM