Rails: uglifier gem won't load - ruby-on-rails

I am getting an error when trying to load server and migrate databases in rails.
My uglifier gem wont load and i need it to run devise properly.
This is the error i get:
There was an error while trying to load the gem 'uglifier'. (Bundler::GemRequireError)
I am running windows 8 if that makes a difference.

Do you have nodejs installed? If not, you can run sudo apt-get install nodejs
P.S. you can do node -v to see if you have nodejs installed.

Related

How to install Rails through a proxy

I was trying to install Ruby on Rails onto my PC, when I got this error:
gem install rails - ERROR: While executing gem (Net::HTTPServerException) 407 “Proxy Authentication Required” [on hold]
I tried:
gem install --http-proxy http://{domain}%5C{username}:{password}#{proxy.address}:{port}/ rails
got the error in the title
I also tried:
gem install -p http://pynewbie:mypassword#the-proxy-host.com:8888 rails
and got the error
ERROR: Could not find a valid gem 'rails' (>= 0), here is why: Unable to download data from https://rubygems.org/ - no such name(https://rubygems.org/specs.4.8.gz)
better to use proxychains to proxy all requests inside your command:
proxychains gem install rails
after install you have to create configuration file on ~/.proxychains/proxychains.conf
proxychains github

uglifier gem load error / download node.js?

I am getting started with Ruby on Rails, and following the steps at InstallRails... I have created the sample_app on the desktop, and now I cannot create the server.
My command
$ rails server
is answered with the following
...There was an error while trying to load the gem 'uglifier'. etc
I have read several threads here and elsewhere, such as this one and this one... In the latter there seems to bea solution, which I can't understand.... I cannot download node.js! or nodejs? What is my command and directory in Gitbash to download it?
It requires JS runtime.
Just install gem therubyracer for the JS runtime.
In the default rails Gemfile,uncomment the line for the gem 'therubyracer' which is commented out.If you dont find it add the gem to your Gemfile like
gem 'therubyracer'
Then run
bundle install
The gem will be installed and it should work.
Otherwise you can install node.js.
For ubuntu
sudo apt-get install nodejs
For mac
brew install nodejs

Install Nodejs for V8 Rails to use Less

I tried to install Bootstrap for Rails, but i always got this error:
Please install gem 'therubyracer' to use Less.
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/less-2.4.0/lib/less/java_sc
ript/v8_context.rb:2:in `require': cannot load such file -- v8 (LoadError)
To avoid this problem i installed nodejs and added this line in config/boot:
ENV['EXECJS_RUNTIME'] = 'Node'
So when i restart my webrich server i see on public indey that the javascript runtime now is nodejs. Then i reapeted the installation of twitter bootstrap but get the same error. I use Rails 4.0 and hope that somebody has an advice for me? Thanks
For Javascript runtime in Rails : Dont use the 'therubyracer' or 'execjs' in your gem files.
First remove those in ur Gemfile and and Remove Gemfile.lock.
After that do this following installation for nodejs.
sudo apt-get install nodejs
I am considering your environment as ubuntu/linux. So for that use above command
And Bundle your app.
Hope this will help you.

linecache19 with ruby 1.9.3-p194 and rvm

I've been trying to install linecache19 following these instructions
curl -OL http://rubyforge.org/frs/download.php/75414/linecache19-0.5.13.gem
gem install linecache19-0.5.13.gem -- --with-ruby-include=$rvm_path/src/ruby-1.9.3-p194/
I seem to be able to run curl -OL http://rubyforge.org/frs/download.php/75414/linecache19-0.5.13.gem just fine, but when I run gem install linecache19-0.5.13.gem -- --with-ruby-include=$rvm_path/src/ruby-1.9.3-p194/ I get this output:
ERROR: Could not find a valid gem 'linecache19-0.5.13.gem' (>= 0) in any repository
ERROR: Possible alternatives: linecache193
I am running all these commands in the root directory of my rails app.
EDIT
I'm using RubyMine, so I think I have to stick with the somewhat older debugging tools
EDIT 2
I got this to work by visiting the rubygems page and downloading linecache19 from there, then running gem install from the download directory
Something was amiss when I tried to curl the gem. When I visited the rubyforge site and downloaded the gem manually, everything worked.

updating the ruby gem 1.8.5

hiii
i am trying to update my gem file. Current version of gem is 1.8.5
When i am trying to update it using command " gem install rubygems-update -v 1.8.5 " it is giving following error
**
ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError)
SocketError: getaddrinfo: Name or service not known
(http://rubygems.org/gems/rubygems-update-1.8.5.gem)
**
I am working on ubuntu 10.04
also i tried to update using command " gem update --system "
it is giving the error as below
Updating rubygems-update
**
ERROR: While executing gem ... (Gem::GemNotFoundException)
Could not find a valid gem 'rubygems-update' (1.8.6) locally or in
a repository
**
i also tried the solution given on the link http://lightyearsoftware.com/2009/07/updating-rubygems-to-recent-1-3-x/
please help me to resolve the problem..
If you are under Windows 7, run the command prompt as Administrator.
Read this thread. The error reported is the same of yours.
Try to apply the Google DNS configuration to your connection.
Otherwise you can try to install locally the gem, downloading it on rubygems.org. After this, in the directory you downloaded the gem, try to install it locally with the command: gem install gem_name --local
I also had this error. I resolved it with
gem uninstall rubygems-update
(you may need to be sudo) and then reinstalled with
gem install rubygems-update
now it's working fine, hope this is helpful
Try this:
Manually uninstall the gem you want to remove: gem uninstall [gemToUinistall]
Download the gem manually from http://rubygems.org/
try to install the gem from local : gem install [gemToInstall]

Resources