Unable to start new rails project - incompatible library version - ruby-on-rails-5

I just installed a new app with rails new crm
after bundle install and rails s i am unable to start server.
rails version is 5.2.3 ruby is 2.5.1
I'm stuck on how to fix this. Can someone please help me?
/Users/MyName/.gem/ruby/2.5.1/gems/pg-1.1.4/lib/pg.rb:4:in `require':
incompatible library version -
/Users/MyName/.gem/ruby/2.5.1/gems/pg-1.1.4/lib/pg_ext.bundle
(LoadError)

Try below step it should solv the issue
rvm gemset empty
gem install bundler
bundle install

Related

RMagick installed but ZenTest doesnt work (Invalid gemspec error)

Hello I have Windows 7 64b and I want to use CarrierWave gem for working with file uploads. I needed to install RMagick... I have succesfully installed rmagick 2.13.2
but if I run
rails g uploader image
it thows me
Invalid gemspec in [C:/web/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/specific
ations/ZenTest-4.9.2.gemspec]: Illformed requirement ["< 2.1, >= 1.8"]
I thought that updating rubygem should help so I did it. Now I have rubygems version 2.0.3 (I hope its not a problem because downgrading like gem update --system 1.9.3 its not working)
I'm not able to uninstall ZenTest too... what I have to do? Thank you!
I uninstalled RailsInstaller and deleted Ruby folder, i deleted JRuby folder from C:\ (i had it for other work) and again installed RailsInstaller and now it works :-)

Getting Rails working with a JS runtime environment

I'm using Ubuntu 11.10 and the terminal to install and run Rails. Here
is the process I've taken so far to setup Rails:
download and install Ruby 1.9.2 and Rails 3.1.0
-- I did this using sudo apt-get ruby1.9.1 and sudo gem install
rails
I made a new rails app using rails new path/to/app
I went to the new app directory and tried running rails server and got an
error about not having a JS ruby environment
I had to get a JS runtime environment for execjs so I downloaded 'therubyracer'
as well as 'therubyrhino' and added them to my gem file, one at a time like this:
gem
'therubyracer' then ran bundle install
After everything was successful with the install, I ran rails server again
-- with both runtime environments I have had similar errors:
Could not find libv8-3.3.10.4 in any of the sources
Run `bundle install` to install missing gems.
Could not find therubyrhino-1.73.0 in any of the sources
Run `bundle install` to install missing gems.
Bundle knows where these programs live, giving correct pathnames when I
enter bundle show libv8 or bundle show therubyrhino. They are both
in /usr/lib/ruby/gems/1.9.1/gems/_ where all the other gems are
located for the bundle install.
Does anyone know where this exception is coming up in the Rails source
code? Does anyone know how Rails is gathering the gems? Better yet,
anyone had this problem and know how to fix it?
Thanks so much,
Feav
Have you tried starting the server using bundle exec rails server?
This problem has been fixed in a newer version of Rails.

file 'lib' not found when installing rails 3.1 on Mac OS X Lion

I just installed rvm and then rails 3.1rc5 with:
gem install rails --pre
But I got some errors after "Installing ri documentation" and the RDoc documentation:
Successfully installed <bunch of things>
30 gems installed
Installing ri documentation for multi_json-1.0.3...
Installing ri documentation for activesupport-3.1.0.rc5...
Installing ri documentation for builder-3.0.0...
unable to convert "\xF1" from ASCII-8BIT to UTF-8 for README, skipping
unable to convert "\xF1" from ASCII-8BIT to UTF-8 for README.rdoc, skipping
Installing ri documentation for i18n-0.6.0...
Installing <tons more documentation>
Installing ri documentation for rails-3.1.0.rc5...
file 'lib' not found
Installing RDoc documentation for multi_json-1.0.3...
Installing RDoc documentation for activesupport-3.1.0.rc5...
Installing RDoc documentation for builder-3.0.0...
unable to convert "\xF1" from ASCII-8BIT to UTF-8 for README, skipping
unable to convert "\xF1" from ASCII-8BIT to UTF-8 for README.rdoc, skipping
Installing RDoc documentation for i18n-0.6.0...
Installing <tons more documentation>
Installing RDoc documentation for rails-3.1.0.rc5...
file 'lib' not found
The README file issues don't seem to be a big deal, but the 'lib' file not found sounds a bit scary.. why is it doing that? Some searching revealed others having this problem and fixing it with gem install rdoc and then re-running gem install rails --pre. But that still gives the same lib file missing errors for me.
Try using rvm gemset install rails --pre
I installed 3.1.0 on Windows (not rc8, but the final release), and got the "file 'lib' not found" error, installing both ri and RDoc. When I type in 'which ruby', I see it installed in the c:/ruby192/bin directory. I had to create a .rvm directory for myself -- it was not created as part of the install.
the --no-rdoc --no-ri worked, of course. The --pre commands installed rc8 instead of the final release.
What gives?
Installing RDoc fixed this problem for me. I had to do this in the gemset I was using.
rvm use rubyversion#gemset
gem install rdoc
After this I could install gems without the "file 'lib' not found" error.
I had the same problem with rails 3.0.9 on my Mac OS X Lion and the "rvm gemset install rails" trick solved it !
$ rvm gemset install rails
installing rails ...
rails installed.
$ rails -v
Rails 3.0.9
Thanks !
I had a similar issue before, while my solution was this: try to use ruby 1.9.2-head instead of ruby 1.9.2-p290.
rvm install ruby-1.9.2-head
rvm use ruby-1.9.2-head --default
And then, install rails 3.1 again.

Mac OS X Leopard showing different version of Rails after install

so I'm installing rails with
gem install rails
and I didn't have any version of rails prior to the one I'm installing (3.0.9).
By the time the installation finishes I get the documentation error
Installing ri documentation for rails-3.0.9...
file 'lib' not found
Installing RDoc documentation for rails-3.0.9...
Even though it says that rails 3.0.9 was installed successfully.
If I run
gem list rails
it shows me version 3.0.9, but when I run
rails -v
it shows me version 2.3.5 ( I don't know here that came from ).
See: http://cl.ly/353h1o1b3y3T260L3F3p
Any help please?
If you don't really care, just remove rails 2.3.5 with gem uninstall rails and chose the appropriate one when it asks you which.

Project broken with Bundler errors after RVM install

I installed RVM and installed 3 different rubies: 1.8.7, ree, and 1.9.2.
I have a Rails 3.0.9 project that uses 1.8.7.
Now when I try to run the 3.0.9 project, I get this error:
Could not find xml-simple-1.1.0 in any of the sources
However, the following command:
bundle show xml-simple
yields:
/Users/me/.rvm/gems/ruby-1.8.7-p334/gems/xml-simple-1.1.0
Looks right to me. What am I missing here? The application, when running, is clearly not seeing the right path. Yet Bundler, when run at the command line, sees it just fine. I am not certain where these paths are to be set. I am admittedly new to RVM, I installed it because I want to start a new edge project with 1.9.2.
Thank you for any help you can provide.
I needed to learn how to create a gemset, then switch to that gemset. You can always check your gem and ruby environment with rvm using:
rvm info
That's what clued me in. Once I "use"d the appropriate gemset where the gem was installed, it worked great.