Newbie - error running Rails: uninitialized constant Sass::Script (NameError)

Hi all,

I’m following Michael H.'s Ruby on Rails tutorial and stumbled at
Listing 1.7: Running the Rails server on the cloud IDE. After editing
the gemfile and inputting “$ rails server -b $IP -p $PORT”, I get the
below error message.

Does “<top (required)>” mean that I missed a step in the setup? How do I
debug?

Thanks,
Jenny

(link to Michael H.'s tutorial:
https://www.railstutorial.org/book/beginning#cha-beginning)

/usr/local/rvm/gems/[email protected]/gems/sass-rails-5.0.1/lib/sass/rails/helpers.rb:11:in
<top (required)>': uninitialized constant Sass::Script (NameError) from /usr/local/rvm/gems/[email protected]/gems/sass-rails-5.0.1/lib/sass/rails.rb:8:inrequire’
from
/usr/local/rvm/gems/[email protected]/gems/sass-rails-5.0.1/lib/sass/rails.rb:8:in
<top (required)>' from /usr/local/rvm/gems/[email protected]/gems/sass-rails-5.0.1/lib/sass-rails.rb:1:inrequire’
from
/usr/local/rvm/gems/[email protected]/gems/sass-rails-5.0.1/lib/sass-rails.rb:1:in
<top (required)>' from /usr/local/rvm/gems/[email protected]/gems/bundler-1.7.6/lib/bundler/runtime.rb:76:inrequire’
from
/usr/local/rvm/gems/[email protected]/gems/bundler-1.7.6/lib/bundler/runtime.rb:76:in
block (2 levels) in require' from /usr/local/rvm/gems/[email protected]/gems/bundler-1.7.6/lib/bundler/runtime.rb:72:ineach’
from
/usr/local/rvm/gems/[email protected]/gems/bundler-1.7.6/lib/bundler/runtime.rb:72:in
block in require' from /usr/local/rvm/gems/[email protected]/gems/bundler-1.7.6/lib/bundler/runtime.rb:61:ineach’
from
/usr/local/rvm/gems/[email protected]/gems/bundler-1.7.6/lib/bundler/runtime.rb:61:in
require' from /usr/local/rvm/gems/[email protected]/gems/bundler-1.7.6/lib/bundler.rb:133:inrequire’
from /home/ubuntu/workspace/hello_app/config/application.rb:7:in
<top (required)>' from /usr/local/rvm/gems/[email protected]/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:78:inrequire’
from
/usr/local/rvm/gems/[email protected]/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:78:in
block in server' from /usr/local/rvm/gems/[email protected]/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:intap’
from
/usr/local/rvm/gems/[email protected]/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in
server' from /usr/local/rvm/gems/[email protected]/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:39:inrun_command!’
from
/usr/local/rvm/gems/[email protected]/gems/railties-4.2.0/lib/rails/commands.rb:17:in
<top (required)>' from /home/ubuntu/workspace/hello_app/bin/rails:8:inrequire’
from /home/ubuntu/workspace/hello_app/bin/rails:8:in <top (required)>' from /usr/local/rvm/gems/[email protected]/gems/spring-1.1.3/lib/spring/client/rails.rb:27:inload’
from
/usr/local/rvm/gems/[email protected]/gems/spring-1.1.3/lib/spring/client/rails.rb:27:in
call' from /usr/local/rvm/gems/[email protected]/gems/spring-1.1.3/lib/spring/client/command.rb:7:incall’
from
/usr/local/rvm/gems/[email protected]/gems/spring-1.1.3/lib/spring/client.rb:26:in
run' from /usr/local/rvm/gems/[email protected]/gems/spring-1.1.3/bin/spring:48:in<top (required)>’
from
/usr/local/rvm/gems/[email protected]/gems/spring-1.1.3/lib/spring/binstub.rb:11:in
load' from /usr/local/rvm/gems/[email protected]/gems/spring-1.1.3/lib/spring/binstub.rb:11:in<top (required)>’
from /home/ubuntu/workspace/hello_app/bin/spring:13:in require' from /home/ubuntu/workspace/hello_app/bin/spring:13:in<top
(required)>’
from bin/rails:3:in load' from bin/rails:3:in

Hmm, no dice either way.

I tried:

  1. Running ‘bundle install’ followed by the rails server command ‘rails
    server -b $IP -p $PORT’.

  2. Deleting

gem ‘sass-rails’, ‘5.0.1’,

re-ran ‘bundle install’,

and then the rails server command ‘rails server -b $IP -p $PORT’.

Seems to be the same error both times.

Thanks for the thought. What do you think?

Same error message. Also emailed Mike Hartl. Will report if I solve
this.

I had the same problem, but commenting out the sass-rails gem worked for
me. I was able to do this with both the default Gemfile and the one
provided in the listing.

Also, I found that using the Gemfile in the listing and upgrading to
sass-rails 5.0.2 also worked.

I’m late in my thanks. Much appreciated, Jesus and Drew. hello, world!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs