I\'m starting my first project on Ruby and the tutorial I\'m following has me using rails. When I try to run $ rails server
I get an error that says: Could not
I had the same problem in Windows 10, I fix the "gem install uglifier" command
the path was like this: C: \ xampp \ htdocs \ parent_folder \ name_project> gem install uglifier
Check if your Gemfile has the following gem
gem 'uglifier'
If the Gem is not present add it to your Gemfile. Sometimes it turns out that your Gemfile.lock has the dependency but you might have commented the Gem in Gemfile.
I you already have the gem in Gemfile run bundle install and check if the bundler is installing the uglifier gem
install nodejs
apt-get install nodejs
** For Windows **
Install Nodejs. If it's already installed add it's path in Environment Variables
Variable Name: Path Location : Where node is installed (C:\Program Files\nodejs)
Re run The command rails server
I was following these instructions: Installing Ruby, Rails and Rubymine in Ubuntu 14.04
and had the same problem when I got to testing the rails server. while creating the new demo:
abc@ubuntu:~/rails_demo$ rails new demo
An error occurred while installing uglifier (2.5.3), and Bundler cannot continue.Make sure that
gem install uglifier -v '2.5.3'
succeeds before bundling. run bundle exec spring binstub --al
I did not catch the above until I attempted to run the server
abc@ubuntu:~/rails_demo/demo$ rails server
Could not find gem 'uglifier (>= 1.3.0) ruby' in the gems available on this machine.
Run `bundle install` to install missing gems.
abc@ubuntu:~/rails_demo/demo$ bundle install uglifier
ERROR: "bundle install" was called with arguments ["uglifier"]
Usage: "bundle install [OPTIONS]"
running the following fixed the problem:
gem install uglifier -v '2.5.3'
bundle exec spring binstub --all
hope it helps