I\'ve tried a number of things like uninstalling/reinstalling rails and gems but to no avail.
When I go into my new project and run rails s or bundle exec rails serv
Had this error recently, it is caused by spring, because of its suggested code in executables:
begin
load File.expand_path('../spring', __FILE__)
rescue LoadError
end
It originally expects a LoadError
for spring itself in production, but by this code all other load error will be ignored too.
Thus if you have any other LoadError
in rails loading process (for example in routes/init) spring worker startup fails and then there goes branch that tries to load everything again like there was no spring.
I couldn't find the an_initilizer.rb in my directory and I tried uninstalling/installing the spring gem but it didn't work.
However I did managed to finally get it working.
Apparently there is some conflict with spring and rails 4+.
I needed to run:
rake rails:update:bin
But I ran across another error:
Library not loaded: libmysqlclient.18.dylib
I ran the following command which I found on another stackoverflow post:
sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib
Then ran the original command:
rake rails:update:bin
Then run the server command:
rails s
And now my WebBrick Server is running.
I got the same error, it happend to be related to gem dotenv
.
Instructions were to add the following to Gemfile:
gem 'dotenv', :require => 'dotenv/rails-now'
But as it turned out, dotenv/rails-now
caused the error. If you use dotenv
don't require rails-now
I received this error after upgrading rails. Disabling spring
give me a hint that the issue was with:
gem 'google-api-client', require: 'google/api_client'
Changed to:
gem 'google-api-client', '0.9'
Resolved the issue.
I got this error by trying to update rails 4 and imagemagick and rmagick. So I just ran
gem uninstall rmagick
Select the All Versions option. Then try again
EDIT: This happaned again with me just now because I tried to use a gem without installing the required base gem. In my case the solution was to install 'omniauth-google' before trying to use 'omniauth-google-oauth2', but because I didn't install I got the same error again
I had the same error message output when trying to start an application within a Vagrant environment. It cropped up out of nowhere after zero changes to the application code (and other weird behaviour followed, such as development.rb being deleted upon attempting to run the app).
In the end I simply halted the VM & restarted it, everything was then fine so I'm assuming it was an issue with file syncing / shared folders perhaps? (default Vagrant shared folder being used).