1

I changed my distro from Ubuntu to Elementary OS. I kept my /home directory, so that I don't have to install anything.

I followed GoRail's guide to install Rails.

Now when I try to re-install everything from the same guide, it turns out that RVM, Ruby and Rails are already there.

➜  sample_app git:(master) ✗ rails -v
Rails 4.2.2

However, when I go to my old projects and try to start a server it throws the following error:

➜  sample_app git:(master) ✗ rails s
/home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/bundler-1.11.2/lib/bundler/runtime.rb:80:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'uglifier'. (Bundler::GemRequireError)
    from /home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/bundler-1.11.2/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
    from /home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `each'
    from /home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `block in require'
    from /home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `each'
    from /home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `require'
    from /home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/bundler-1.11.2/lib/bundler.rb:99:in `require'
    from /home/abhimanyuaryan/Public/RoR/sample_app/config/application.rb:7:in `<top (required)>'
    from /home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:78:in `require'
    from /home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:78:in `block in server'
    from /home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:75:in `tap'
    from /home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:75:in `server'
    from /home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
    from /home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/railties-4.2.2/lib/rails/commands.rb:17:in `<top (required)>'
    from /home/abhimanyuaryan/Public/RoR/sample_app/bin/rails:9:in `require'
    from /home/abhimanyuaryan/Public/RoR/sample_app/bin/rails:9:in `<top (required)>'
    from /home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/spring-1.1.3/lib/spring/client/rails.rb:27:in `load'
    from /home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/spring-1.1.3/lib/spring/client/rails.rb:27:in `call'
    from /home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/spring-1.1.3/lib/spring/client/command.rb:7:in `call'
    from /home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/spring-1.1.3/lib/spring/client.rb:26:in `run'
    from /home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/spring-1.1.3/bin/spring:48:in `<top (required)>'
    from /home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/spring-1.1.3/lib/spring/binstub.rb:11:in `load'
    from /home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/spring-1.1.3/lib/spring/binstub.rb:11:in `<top (required)>'
    from /home/abhimanyuaryan/Public/RoR/sample_app/bin/spring:13:in `require'
    from /home/abhimanyuaryan/Public/RoR/sample_app/bin/spring:13:in `<top (required)>'
    from bin/rails:3:in `load'
    from bin/rails:3:in `<main>'
➜  sample_app git:(master) ✗ 
the Tin Man
  • 158,662
  • 42
  • 215
  • 303
abhimanyuaryan
  • 3,882
  • 5
  • 41
  • 83

1 Answers1

1

As per your error message

There was an error while trying to load the gem 'uglifier'. (Bundler::GemRequireError)

It seems you don't have NodeJS installed. Run

sudo apt-get install nodejs
bundle install

See "There was an error while trying to load the gem 'uglifier'. (Bundler::GemRequireError)".

Community
  • 1
  • 1