Ruby on Rails - Error Making New App (Rb:55:In 'Require')

Ruby on Rails - Error making new app (rb:55:in 'require')

As per zwippie's answer in the comment section, the solution was achieved as follows.

rails -v produced a very similar looking output to the error message above.

gem install rails after hanging for a second installed rails successfully. I am now able to add a new project.

I'm unsure why this has happened as I've been successfully making new rails projects both on this laptop and in this directory for the last two weeks, even up until this morning. However as zwippie notes perhaps this is an RVM setup issue. I'll go away and read up but if anyone had any additional pointers from documentation that might shed light on the issue I'm appreciate any links in the comment.

Many thanks all.

Error when loading Rails server (Rails 4)

If you look in the source code of the sprockets gem (where the error is coming from) you can see that the error is being raised by these lines:

63  begin
64 if File.exist?(@path)
65 data = json_decode(File.read(@path))
66 end
67 rescue MultiJson::DecodeError => e
68 logger.error "#{@path} is invalid: #{e.class} #{e.message}"
69 end

Line 65 is the problem, specifically File.read(@path) - as shown by your error message (sprockets-2.12.3/lib/sprockets/manifest.rb:65:in `read').

Basically, @path is supposed to be a string representing a filename but it's actually pointing to a directory, which is causing File.read to fail. @path is supposed to be pointing to your asset's manifest file (usually created automatically by Sprockets) and I'm not sure why it's getting the incorrect path here - do you have anything that looks relevant to your manifest file in config/application.rb or in your environment config files? What about in app/assets/javascripts/application.js or app/assets/stylesheets/application.css?

Try editing your local copy of sprockets yourself (run "cd `bundle show sprockets`" from your app's directory to find it) and adding puts @path before line 65 above (just make sure you remember to remove it when you're done!) - what does it say?

tns run ios --emulator is throwing error Command failed: /bin/sh -c ruby -e require 'xcodeproj';

Check NativeScript installition is it correct... try tns doctor if its ok

Rails/Ruby Error When Creating Database: Unable to load the EventMachine C extension

Someone kind of answered in comments...see below.

Basically though I had seperate versions of Ruby, which was getting confusing because some gems were only installed on certain versions of ruby.

Fix was totally uninstalling ruby and rails, then reinstalling. Fixed it!

This helped:

This comment in another thread seems promising for your issue. Can you ensure that you have "gem eventmachine" or similar in your Gemfile, and can successfully bundle? – Scott Helm Jan 6 at 6:24

cannot load such file -- bundler/setup (LoadError)

It could be that there was a previous Ruby env installed on your system prior to your installation of 2.0? This might have had an existing GEM_PATH that lead to the /1.8 directory which the installation of version 2.0 simply kept.

The problem you where likely having, then, was that Passenger/Apache was looking in the /2.0 directory when in fact the gems were in the /1.8 directory. Your explicitly telling apache to use the /1.8 directory thus makes sense to fix the problem.

SetEnv GEM_HOME /usr/lib/ruby/gems/1.8

You might also try using the Ruby Version Manager to handle multiple Ruby envs.

Some things I found in Google:

  • New to Ruby and am having trouble with LOAD_PATH
  • http://weblog.rubyonrails.org/2009/9/1/gem-packaging-best-practices/
  • http://guides.rubygems.org/faqs/


Related Topics



Leave a reply



Submit