There was an error while trying to load the gem 'uglifier'

1,722 views
Skip to first unread message

Fu Qiang Zhang

unread,
Dec 14, 2015, 3:17:09 AM12/14/15
to Ruby on Rails: Talk

I am new to rails.


After I setup env :
1. created first project with command rails new firstrail
2. Enter demo directory
3. run command rails server

Here, I got the error :

uglifier 2.7.2 was installed. I don't know how to fix this error.
Does any know how to fix this ?
Please help me out, thank you !


Colin Law

unread,
Dec 14, 2015, 4:05:54 AM12/14/15
to Ruby on Rails: Talk
Do you see any errors if you run
bundle install
It should not have been necessary to run it manually as it is run automatically when you do rails new, but perhaps there was an error that you did not notice.  It is necessary to re-run bundle if you change Gemfile.

Otherwise then post the details of the error when you run the server please.  Copy/paste the full terminal output that you get when you run
rails s

Colin

Fu Qiang Zhang

unread,
Dec 14, 2015, 7:41:51 AM12/14/15
to Ruby on Rails: Talk
I fixed this error by
uncommenting  gem 'therubyracer', 'platforms: :ruby'  # this is a javascript runtime
in Gemfile

Thank you, Colin.

在 2015年12月14日星期一 UTC+8下午5:05:54,Colin Law写道:

Colin Law

unread,
Dec 14, 2015, 8:31:25 AM12/14/15
to Ruby on Rails: Talk
On 14 December 2015 at 12:41, Fu Qiang Zhang <zfq...@gmail.com> wrote:
>
> I fixed this error by
> uncommenting gem 'therubyracer', 'platforms: :ruby' # this is a javascript runtime
> in Gemfile
>
>
> Thank you, Colin.

Glad to be of help, if I actually was any help.

Colin

ishant kumar

unread,
Apr 23, 2016, 8:34:53 AM4/23/16
to Ruby on Rails: Talk

and i have uncomment the ruby racer also
plaes help me to sort out this problem.

Colin Law

unread,
Apr 23, 2016, 4:49:33 PM4/23/16
to Ruby on Rails: Talk
Copy/paste the error you are getting here.  Also tell us which operating system you are using.

Colin
 

Praveen Kumar

unread,
Apr 24, 2016, 2:24:35 AM4/24/16
to rubyonra...@googlegroups.com
Install nodejs on your system and you'll be fine.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLvZLd%3D5dsxLLztmJ8qpTX%2BjoUqf%3DzVgMdekMWD10s9k6Q%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

ishant kumar

unread,
Apr 25, 2016, 1:54:17 AM4/25/16
to Ruby on Rails: Talk
 my operating system is: windows 7 and my rails version is: 4.2.5.1 and ruby is: ruby 2.1.8p440 (2015-12-16 revision 53160) [i386-mingw32]
whenever i installed nodejs on system this error shows:

D:\rubyproject>gem install nodejs
ERROR:  Could not find a valid gem 'nodejs' (>= 0) in any repository
ERROR:  Possible alternatives: nodes, noderb, modeljs, models, node
what do i do ?
please help me


On Monday, December 14, 2015 at 1:47:09 PM UTC+5:30, Fu Qiang Zhang wrote:

nanaya

unread,
Apr 25, 2016, 1:56:57 AM4/25/16
to rubyonra...@googlegroups.com
Hi,

On Mon, Apr 25, 2016, at 14:54, ishant kumar wrote:
> my operating system is: windows 7 and my rails version is: 4.2.5.1 and
> ruby is: ruby 2.1.8p440 (2015-12-16 revision 53160) [i386-mingw32]
> whenever i installed nodejs on system this error shows:
>
> D:\rubyproject>gem install nodejs
> ERROR: Could not find a valid gem 'nodejs' (>= 0) in any repository
> ERROR: Possible alternatives: nodes, noderb, modeljs, models, node
> what do i do ?
> please help me

Yes, it's a separate program, not part of ruby/gems. Go to
https://nodejs.org/en/ to download it.

Praveen Kumar

unread,
Apr 25, 2016, 1:57:04 AM4/25/16
to rubyonra...@googlegroups.com
nodejs is not a gem.


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.

ishant kumar

unread,
Apr 25, 2016, 12:54:38 PM4/25/16
to Ruby on Rails: Talk
how to make install this nodejs on system i.e on Windows 7?
please help me.

ishant kumar

unread,
Apr 25, 2016, 12:54:43 PM4/25/16
to Ruby on Rails: Talk

Praveen Kumar

unread,
Apr 25, 2016, 12:56:23 PM4/25/16
to rubyonra...@googlegroups.com

Just install the binary file. .exe file

On 25-Apr-2016 10:25 PM, "ishant kumar" <isha...@gmail.com> wrote:
how to make install this nodejs on system i.e on Windows 7?
please help me.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.

ishant kumar

unread,
Apr 26, 2016, 2:18:28 AM4/26/16
to Ruby on Rails: Talk
 how to redirect to any page after logout the user and destroy the sesssion?
please help
my problem is  after logout my app redirect to my index page (root_path page) and i don't want it .how to go to separate separate page  after logout?

vijaya sekhar reddy mallidi

unread,
Apr 26, 2016, 2:36:31 AM4/26/16
to rubyonra...@googlegroups.com
Hi ishant,

  which gem you are using for authentication? I mean are you using devise or authlogic or your own authentication. What kind of user types you are using to redirect different pages after logout?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.

prince nihith

unread,
Jun 17, 2016, 3:53:08 AM6/17/16
to Ruby on Rails: Talk
i dont see any error but, still when i run rails server it is showing the error There was an error while trying to load the gem 'uglifier'
C:\Ruby21-x64\rails\firstapp>bundle install
Using rake 11.2.2
Using i18n 0.7.0
Using json 1.8.3
Using minitest 5.9.0
Using thread_safe 0.3.5
Using builder 3.2.2
Using erubis 2.7.0
Using mini_portile2 2.1.0
Using pkg-config 1.1.7
Using rack 1.6.4
Using mime-types-data 3.2016.0521
Using arel 6.0.3
Using debug_inspector 0.0.2
Using byebug 9.0.5
Using coffee-script-source 1.10.0
Using execjs 2.7.0
Using thor 0.19.1
Using concurrent-ruby 1.0.2
Using multi_json 1.12.1
Using bundler 1.12.5
Using sass 3.4.22
Using tilt 2.0.5
Using sqlite3 1.3.11
Using rdoc 4.2.2
Using tzinfo 1.2.2
Using nokogiri 1.6.8
Using rack-test 0.6.3
Using mime-types 3.1
Using binding_of_caller 0.7.2
Using coffee-script 2.4.1
Using uglifier 3.0.0
Using sprockets 3.6.0
Using sdoc 0.4.1
Using activesupport 4.2.6
Using tzinfo-data 1.2016.5
Using loofah 2.0.3
Using mail 2.6.4
Using rails-deprecated_sanitizer 1.0.3
Using globalid 0.3.6
Using activemodel 4.2.6
Using jbuilder 2.5.0
Using rails-html-sanitizer 1.0.3
Using rails-dom-testing 1.0.7
Using activejob 4.2.6
Using activerecord 4.2.6
Using actionview 4.2.6
Using actionpack 4.2.6
Using actionmailer 4.2.6
Using railties 4.2.6
Using sprockets-rails 3.0.4
Using coffee-rails 4.1.1
Using jquery-rails 4.1.1
Using rails 4.2.6
Using sass-rails 5.0.4
Using web-console 2.3.0
Using turbolinks 2.5.3
Bundle complete! 12 Gemfile dependencies, 56 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.

C:\Ruby21-x64\rails\firstapp>

nanaya

unread,
Jun 17, 2016, 4:01:49 AM6/17/16
to rubyonra...@googlegroups.com
Hi,

On Fri, Jun 17, 2016, at 16:01, prince nihith wrote:
> i dont see any error but, still when i run rails server it is showing the
> error There was an error while trying to load the gem 'uglifier'
> C:\Ruby21-x64\rails\firstapp>bundle install

You should post the complete error instead of just the main message.
Though it looks another case of windows script host error.

either:
1. use something more posix where ruby is actually intended to run (i.e.
not windows) or
2. install nodejs (or just download node executable (node.exe) and put
somewhere in your PATH)

Colin Law

unread,
Jun 17, 2016, 10:08:09 AM6/17/16
to Ruby on Rails: Talk

On 17 June 2016 at 08:01, prince nihith <prince...@gmail.com> wrote:
i dont see any error but, still when i run rails server it is showing the error There was an error while trying to load the gem 'uglifier'
C:\Ruby21-x64\rails\firstapp>bundle install


The big problem you have is that you are trying to develop with Rails using Windows.  I understand some have managed to achieve this but many have had significant problems.  Most developers use Linux or Mac.  My advice is to switch to a Linux distribution (such as Ubuntu).  You can run this in a virtual machine under windows or you can dual boot the PC.  I did the latter (using Ubuntu) when I started working with Rails and now very rarely boot into Windows as the vast majority of applications have equivalent apps on Ubuntu.  It is great to feel that you are back in control of the PC after years of Microsoft dominance.

Colin

Reply all
Reply to author
Forward
0 new messages