I'm using Ubuntu 18.04, Ruby 2.6.3, and Rails 6. I'm working on a new rails project, and when i start the server, i have the following error :
> rails s
=> Booting Puma
=> Rails 6.0.2.1 application starting in development
=> Run `rails server --help` for more startup options
Exiting
Traceback (most recent call last):
[...]
72: from ./bin/rails:3:in `<main>'
71: from ./bin/rails:3:in `load'
70: from /home/franck/code/BTC1M/app-test/bin/spring:15:in `<top (required)>'
69: from /home/franck/.rbenv/versions/2.6.3/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
68: from /home/franck/.rbenv/versions/2.6.3/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
67: from /home/franck/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `<top (required)>'
66: from /home/franck/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `load'
[...]
5: from /home/franck/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.2.1/lib/active_support/lazy_load_hooks.rb:69:in `block in execute_hook'
4: from /home/franck/.rvm/gems/ruby-2.6.3/gems/less-rails-2.6.0/lib/less/rails/railtie.rb:17:in `block in <class:Railtie>'
3: from /home/franck/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/active_support.rb:58:in `load_missing_constant'
2: from /home/franck/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/active_support.rb:79:in `rescue in load_missing_constant'
1: from /home/franck/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/active_support.rb:8:in `without_bootsnap_cache'
/home/franck/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/active_support.rb:79:in `block in load_missing_constant': uninitialized constant Sprockets::Engines (NameError)
I tried to uninstall and re-install rails and ruby (through those steps) :
rvm implode
rm -rf ~/.rvm
rm -rf ~/.rbenv
sudo apt install -y build-essential tklib zlib1g-dev libssl-dev libffi-dev libxml2 libxml2-dev libxslt1-dev libreadline-dev
sudo apt clean
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
rbenv install 2.6.3
rbenv global 2.6.3
gem install rails
I also tried spring stop, and updating sprockets and sprockets-rails : gem update (my sprockets-rails version is 3.2.1), and updating the sprockets-rails version in Gemfile.lock : sprockets-rails (3.2.1). My sprockets version is 4.0.0.
I also added gem 'sprockets', git: 'git://github.com/rails/sprockets' in my gemfile + bundle install (as it was told on this thread : https://github.com/rails/sass-rails/issues/48 ) but it doesn't fix my issue.
I still have the same error. I don't understand what is going on. Any idea ?
By the way, why do i have a /home/franck/.rvm folder (that i deleted before) as i'm not using RVM but RBENV ?
The github repo is here : https://github.com/BTC1M/app-test
Try removing one by one those old dependencies that might not be compatible with rails > 5, and bundle again:
Start with gem 'less-rails-bootstrap' which last commit is 5 years ago, and which is referenced in your error stack.
Also look at those other dependencies:
gem 'jquery-easing-rails' last commit is 5 yo
gem "font-awesome-rails" last commit 3 yo
Also note that bootstrap-sass and font-awesome-rails doesn't support latest versions of those libraries, and might need some hacking to work on Rails 6, you'd better use those librairies with webpack which is the new standard (Sprocket does not handle JS by default anymore, everything happens in app/javascript which is compiled by webpack).
And, you might not need therubyracer anymore (last commit 3 yo and a lot of recent issues).
Related
I am installing passenger + nginx on ubuntu 14.04 & ruby 2.2.4. There are bundler errors with passenger-install-nginx-module
$passenger-install-nginx-module
/home/ubuntu/.rvm/gems/ruby-2.2.4/gems/bundler-1.13.1/lib/bundler/rubygems_ext.rb:45:in `full_gem_path': uninitialized constant Bundler::Plugin::API::Source (NameError)
from /home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/basic_specification.rb:144:in `block in full_require_paths'
from /home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/basic_specification.rb:143:in `map'
from /home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/basic_specification.rb:143:in `full_require_paths'
from /home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/basic_specification.rb:76:in `contains_requirable_file?'
from /home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:949:in `block in find_in_unresolved'
from /home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:949:in `each'
from /home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:949:in `find_all'
from /home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:949:in `find_in_unresolved'
from /home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:74:in `require'
from /home/ubuntu/.rvm/gems/ruby-2.2.4/gems/bundler-1.13.1/lib/bundler/plugin/api/source.rb:2:in `<top (required)>'
from /home/ubuntu/.rvm/gems/ruby-2.2.4/gems/bundler-1.13.1/lib/bundler/rubygems_ext.rb:45:in `full_gem_path'
from /home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/basic_specification.rb:144:in `block in full_require_paths'
from /home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/basic_specification.rb:143:in `map'
from /home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/basic_specification.rb:143:in `full_require_paths'
from /home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:1370:in `add_self_to_load_path'
from /home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:1283:in `activate'
from /home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_gem.rb:67:in `block in gem'
from /home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_gem.rb:66:in `synchronize'
from /home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_gem.rb:66:in `gem'
from /home/ubuntu/.rvm/gems/ruby-2.2.4/bin/passenger-install-nginx-module:22:in `<main>'
from /home/ubuntu/.rvm/gems/ruby-2.2.4/bin/ruby_executable_hooks:15:in `eval'
from /home/ubuntu/.rvm/gems/ruby-2.2.4/bin/ruby_executable_hooks:15:in `<main>'
Before that, gem passenger (v5.0.30) and rails 4.2.0 have been installed. What causes the error?
Had the same problem,
What I did:
gem uninstall bundler -v1.13.1
(or gem uninstall bundler -v1.13)
Then
gem install bundler -v 1.12
Then passenger-install-apache2-module works.
Suggestions here:
https://github.com/fastlane/fastlane/issues/6203
https://github.com/fastlane/fastlane/issues/6066
Check if you have the right version of RubyGems
$ gem -v
2.6.5 (or superior)
If you have not, upgrade your RubyGems:
$ gem update --system
If you can't use sudo like this:
$ sudo gem update --system
Now check you have the last bundler version:
$ bundle -v
Bundler version 1.13.0 (or superior)
If you have not, upgrade your Bundler:
$ gem install bundler
I receive the following error message when running this command:
gem install rails -v 4.2.4
This is the error:
/Users/adamgoldberg/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/yaml.rb:5:in `<top (required)>':
It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby.
/Users/adamgoldberg/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': dlopen(/Users/adamgoldberg/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/x86_64-darwin15/psych.bundle, 9): Library not loaded: /usr/local/opt/libyaml/lib/libyaml-0.2.dylib (LoadError)
Referenced from: /Users/adamgoldberg/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/x86_64-darwin15/psych.bundle
Reason: image not found - /Users/adamgoldberg/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/x86_64-darwin15/psych.bundle
from /Users/adamgoldberg/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/adamgoldberg/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/psych.rb:7:in `<top (required)>'
from /Users/adamgoldberg/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/adamgoldberg/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/adamgoldberg/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/yaml.rb:6:in `<top (required)>'
from /Users/adamgoldberg/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/adamgoldberg/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/adamgoldberg/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems.rb:628:in `load_yaml'
from /Users/adamgoldberg/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/config_file.rb:326:in `load_file'
from /Users/adamgoldberg/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/config_file.rb:198:in `initialize'
from /Users/adamgoldberg/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/gem_runner.rb:75:in `new'
from /Users/adamgoldberg/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/gem_runner.rb:75:in `do_configuration'
from /Users/adamgoldberg/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/gem_runner.rb:40:in `run'
from /Users/adamgoldberg/.rvm/rubies/ruby-2.3.0/bin/gem:21:in `<main>'
Please Help - this is causing me nightmares
It seems your ruby installation is missing psych (for YAML output).
Install libyaml with Homebrew: http://brew.sh; then try gem install rails -v 4.2.4
$ brew info libyaml
libyaml: stable 0.1.6 (bottled)
YAML Parser
http://pyyaml.org/wiki/LibYAML
Not installed
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/libyaml.rb
==> Options
--universal
Build a universal binary
$ brew install libyaml
==> Downloading https://homebrew.bintray.com/bottles/libyaml-0.1.6_1.el_capitan.bottle.tar.gz
######################################################################## 100.0%
==> Pouring libyaml-0.1.6_1.el_capitan.bottle.tar.gz
🍺 /usr/local/Cellar/libyaml/0.1.6_1: 8 files, 312.8K
REINSTALL RUBY
If the above solution doesn't work for you, reinstall Ruby from scratch with rvm or rbenv,
1) Try the instructions on this accepted answer: https://stackoverflow.com/a/38194139/1076207
—OR—
2) Remove all rvm files, then reinstall rvm: https://stackoverflow.com/a/38158619/1076207
—OR—
3) Remove all rvm files, then install rbenv: https://stackoverflow.com/a/38194231/1076207
After using one of the three options above, use http://bundler.io to install Rails:
$ mkdir ~/Documents/Repo
$ cd ~/Documents/Repo
$ gem install bundler
[…]
$ bundle init
Writing new Gemfile to /Users/username/Documents/Repo/Gemfile
$ echo "gem 'rails', '4.2.4'" >> Gemfile
$ bundle install
[…]
$ bundle exec rails new project_name
[…]
$ cd project_name
Personally, I recommend 3) switch to rbenv—I did.
The error itself clearly says that you should install libyaml first and then re-install your ruby. You can do it by running following commands.
sudo apt-get install libtool
rvm package install libyaml
rvm reinstall ruby-2.3.0
for more reference please see this answer
[ec2-user#ip-XX-XXX-XXX-XXX rails]$ rails -h
/usr/share/ruby/vendor_ruby/2.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- io/console (LoadError)
from /usr/share/ruby/vendor_ruby/2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/share/ruby/gems/2.0/gems/thor-0.19.1/lib/thor/shell/basic.rb:2:in `<top (required)>'
from /usr/share/ruby/vendor_ruby/2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/share/ruby/vendor_ruby/2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/share/ruby/gems/2.0/gems/thor-0.19.1/lib/thor/shell/color.rb:1:in `<top (required)>'
from /usr/local/share/ruby/gems/2.0/gems/thor-0.19.1/lib/thor/shell.rb:17:in `shell'
from /usr/local/share/ruby/gems/2.0/gems/thor-0.19.1/lib/thor/base.rb:439:in `start'
from /usr/local/share/ruby/gems/2.0/gems/railties-4.1.0/lib/rails/commands/application.rb:17:in `<top (required)>'
from /usr/share/ruby/vendor_ruby/2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/share/ruby/vendor_ruby/2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/share/ruby/gems/2.0/gems/railties-4.1.0/lib/rails/cli.rb:14:in `<top (required)>'
from /usr/share/ruby/vendor_ruby/2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/share/ruby/vendor_ruby/2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/share/ruby/gems/2.0/gems/railties-4.1.0/bin/rails:9:in `<top (required)>'
from /usr/local/bin/rails:23:in `load'
from /usr/local/bin/rails:23:in `<main>'
I did install Ruby on Rails using $ gem install rails and it completed fine as well. I had checked the process status with $echo $? and it was 0 meaning successful.
Interestingly these two commands work fine:
$ which rails
/usr/local/bin/rails
$ rails -v
Rails 4.1.0
This is a Amazon Web Services AMI image 64 bit. Please help me figure this out.
I have the bundler installed:
$ gem install bundler
Fetching: bundler-1.6.2.gem (100%)
Successfully installed bundler-1.6.2
Parsing documentation for bundler-1.6.2
Installing ri documentation for bundler-1.6.2
Done installing documentation for bundler after 5 seconds
1 gem installed
I checked for duplicate installs:
$ find / 2>/dev/null| grep bin/ruby
/usr/bin/ruby
/usr/bin/ruby2.0
$ find / 2>/dev/null| grep bin/rails
/usr/local/share/ruby/gems/2.0/gems/railties-4.1.0/bin/rails
/usr/local/share/ruby/gems/2.0/gems/railties-4.1.0/lib/rails/generators/rails/plugin/templates/bin/rails.tt
/usr/local/share/ruby/gems/2.0/gems/railties-4.1.0/lib/rails/generators/rails/app/templates/bin/rails
/usr/local/share/ruby/gems/2.0/gems/rails-4.1.0/guides/code/getting_started/bin/rails
/usr/local/bin/rails
/home/ec2-user/.gem/ruby/2.0/gems/rails-4.1.0/guides/code/getting_started/bin/rails
You would need to install io-console gem. Install it using following command:
gem install io-console
After this run rails -h
Also, run echo $PATH and make sure that you have /usr/local/bin in the path. If not, then you would need to add it.
So I had resolved this the same night, but somehow Stackoverflow didnt send me any notifications on the responses to the question, so I didnt know of these responses. This is what I ended up doing. It was essentially removing the ruby on rails installation and installing it from scratch. This was on a Amazon Web services server - linux flavor.
sudo yum update
$wget https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer
$ bash -s stable < rvm-installer
$ source /home/ec2-user/.rvm/scripts/rvm
$ rvm requirements
$ sudo yum erase ruby
$ rvm install ruby
$ rvm use ruby --default
$ rvm rubygems current
$ gem install rails # this takes forever
After that it worked just fine.
I had exactly the same issue on AWS Elastic Beanstalk (Puma, Ruby 2, Rails 4.0):
> rails generate simple_form:install --bootstrap
/usr/local/share/ruby/gems/2.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require': cannot load such file -- io/console (LoadError)
I simply added:
gem 'io-console'
To the top of my Gemfile and ran bundle install again on the box for great success. Hopefully quicker than reinstalling rails for anyone else who runs in to this.
Thanks; you need io-console indeed. To make that work, install GCC. Rest is needed later on so:
yum -y install gcc mysql-devel ImageMagick-devel
Then,
gem install io-console
works and I could continue installing.
I'm trying to run one quite old Rails application on Mavericks where one of the requirements are:
- Ruby ree-1.8.7-2009.10
- Rails 3.0.0
- libxml-ruby 1.1.4 (that's the latest version compatible with the rest of the gems.
I have latest libxml2 package installed. It's version from Homebrew (2.9.1).
To install this gem I used following command:
$ CC=gcc-4.2 gem install libxml-ruby -v '1.1.4'
Output suggested success:
Building native extensions. This could take a while...
Successfully installed libxml-ruby-1.1.4
1 gem installed
though when I try run some rake task, i.e. creating database
bundle exec rake db:create
I get following error:
$ bundle exec rake db:create [ree-1.8.7-2009.10#mygemset]
rake aborted!
dlsym(0x7ffa2d83bbe0, Init_libxml_ruby): symbol not found - /Users/myuser/.rvm/gems/ree-1.8.7-2009.10#mygemset/gems/libxml-ruby-1.1.4/lib/libxml_ruby.bundle
/Users/myuser/.rvm/gems/ree-1.8.7-2009.10#mygemset/gems/libxml-ruby-1.1.4/lib/libxml_ruby.bundle
/Users/myuser/.rvm/gems/ree-1.8.7-2009.10#mygemset/gems/activesupport-3.0.20/lib/active_support/dependencies.rb:242:in `require'
/Users/myuser/.rvm/gems/ree-1.8.7-2009.10#mygemset/gems/activesupport-3.0.20/lib/active_support/dependencies.rb:225:in `load_dependency'
/Users/myuser/.rvm/gems/ree-1.8.7-2009.10#mygemset/gems/activesupport-3.0.20/lib/active_support/dependencies.rb:597:in `new_constants_in'
/Users/myuser/.rvm/gems/ree-1.8.7-2009.10#mygemset/gems/activesupport-3.0.20/lib/active_support/dependencies.rb:225:in `load_dependency'
/Users/myuser/.rvm/gems/ree-1.8.7-2009.10#mygemset/gems/activesupport-3.0.20/lib/active_support/dependencies.rb:242:in `require'
/Users/myuser/.rvm/gems/ree-1.8.7-2009.10#mygemset/gems/libxml-ruby-1.1.4/lib/libxml.rb:9
/Users/myuser/.rvm/gems/ree-1.8.7-2009.10#mygemset/gems/activesupport-3.0.20/lib/active_support/dependencies.rb:242:in `require'
/Users/myuser/.rvm/gems/ree-1.8.7-2009.10#mygemset/gems/activesupport-3.0.20/lib/active_support/dependencies.rb:242:in `require'
/Users/myuser/.rvm/gems/ree-1.8.7-2009.10#mygemset/gems/activesupport-3.0.20/lib/active_support/dependencies.rb:225:in `load_dependency'
/Users/myuser/.rvm/gems/ree-1.8.7-2009.10#mygemset/gems/activesupport-3.0.20/lib/active_support/dependencies.rb:597:in `new_constants_in'
/Users/myuser/.rvm/gems/ree-1.8.7-2009.10#mygemset/gems/activesupport-3.0.20/lib/active_support/dependencies.rb:225:in `load_dependency'
/Users/myuser/.rvm/gems/ree-1.8.7-2009.10#mygemset/gems/activesupport-3.0.20/lib/active_support/dependencies.rb:242:in `require'
/Users/myuser/Developer/my-project/vendor/private_gems/restful_authentication-1.4.9/lib/sso/sso.rb:3
/Users/myuser/.rvm/gems/ree-1.8.7-2009.10#mygemset/gems/activesupport-3.0.20/lib/active_support/dependencies.rb:242:in `require'
/Users/myuser/.rvm/gems/ree-1.8.7-2009.10#mygemset/gems/activesupport-3.0.20/lib/active_support/dependencies.rb:242:in `require'
/Users/myuser/.rvm/gems/ree-1.8.7-2009.10#mygemset/gems/activesupport-3.0.20/lib/active_support/dependencies.rb:225:in `load_dependency'
/Users/myuser/.rvm/gems/ree-1.8.7-2009.10#mygemset/gems/activesupport-3.0.20/lib/active_support/dependencies.rb:597:in `new_constants_in'
/Users/myuser/.rvm/gems/ree-1.8.7-2009.10#mygemset/gems/activesupport-3.0.20/lib/active_support/dependencies.rb:225:in `load_dependency'
/Users/myuser/.rvm/gems/ree-1.8.7-2009.10#mygemset/gems/activesupport-3.0.20/lib/active_support/dependencies.rb:242:in `require'
/Users/myuser/Developer/my-project/vendor/private_gems/restful_authentication-1.4.9/lib/restful_sso_authentication.rb:2
/Users/myuser/.rvm/gems/ree-1.8.7-2009.10#global/gems/bundler-1.5.2/lib/bundler/runtime.rb:76:in `require'
/Users/myuser/.rvm/gems/ree-1.8.7-2009.10#global/gems/bundler-1.5.2/lib/bundler/runtime.rb:76:in `require'
/Users/myuser/.rvm/gems/ree-1.8.7-2009.10#global/gems/bundler-1.5.2/lib/bundler/runtime.rb:72:in `each'
/Users/myuser/.rvm/gems/ree-1.8.7-2009.10#global/gems/bundler-1.5.2/lib/bundler/runtime.rb:72:in `require'
/Users/myuser/.rvm/gems/ree-1.8.7-2009.10#global/gems/bundler-1.5.2/lib/bundler/runtime.rb:61:in `each'
/Users/myuser/.rvm/gems/ree-1.8.7-2009.10#global/gems/bundler-1.5.2/lib/bundler/runtime.rb:61:in `require'
/Users/myuser/.rvm/gems/ree-1.8.7-2009.10#global/gems/bundler-1.5.2/lib/bundler.rb:131:in `require'
/Users/myuser/Developer/my-project/config/application.rb:5
/Users/myuser/Developer/my-project/Rakefile:6:in `require'
/Users/myuser/Developer/my-project/Rakefile:6
(See full trace by running task with --trace)
I have tried numerous approaches that can be found on Internet (the most relevant examples concerned problems with installing Nokogiri and similar errors where listed) and none of them worked.
Here is my way to install Rubies on variety of Mac OSes for long long time. For me, there were any no problems with any library or gem. For example more complex Nokogiri gem builds and works like a charm.
Check XCode version
xcodebuild -version
xcode-select --install
Install Homebrew as per it's documentation
Install prerequisites
brew doctor; # Just do what it wants!
brew update;
brew upgrade; # Watch out! for existing bottles
brew install libtool libxml2 libxslt openssl sqlite libyaml;
brew install autoconf automake apple-gcc42;
brew cleanup; # Watch out! for existing bottles
brew tap homebrew/dupes; # Watch out! for existing bottles
Install RVM
curl -L https://get.rvm.io | bash -s stable # Latest stable
rvm get latest
rvm reload # :)
rvm autolibs enable
rvm requirements
Install Ruby
rvm install 2.1 --disable-binary
Probably a previous version break the native loading or your libxml2 is too recent and don't fit the gem implementation.
first uninstall all previous gems (gemset, system)
then reinstall the gem
https://gist.github.com/unixcharles/1226596 ?
I am completely new to Ruby, Rails, and MySQL. I am trying to start a new project and start the default server and I get the error listed below. I have the following installed:
Ruby : ruby 1.8.7 (2008-08-11 patchlevel 72) [i686-darwin9.8.0]
Rails: rails (3.0.7)
MySql: mysql2 (0.2.7)
RubyGems: 1.7.2
Error is below:
$ rails s
/usr/local/lib/ruby/gems/1.8/gems/mysql2-0.2.7/lib/mysql2/mysql2.bundle: dlsym(0x251680, Init_mysql2): symbol not found - /usr/local/lib/ruby/gems/1.8/gems/mysql2-0.2.7/lib/mysql2/mysql2.bundle (LoadError)
from /usr/local/lib/ruby/gems/1.8/gems/mysql2-0.2.7/lib/mysql2.rb:8
from /usr/local/lib/ruby/gems/1.8/gems/bundler-1.0.12/lib/bundler/runtime.rb:68:in `require'
from /usr/local/lib/ruby/gems/1.8/gems/bundler-1.0.12/lib/bundler/runtime.rb:68:in `require'
from /usr/local/lib/ruby/gems/1.8/gems/bundler-1.0.12/lib/bundler/runtime.rb:66:in `each'
from /usr/local/lib/ruby/gems/1.8/gems/bundler-1.0.12/lib/bundler/runtime.rb:66:in `require'
from /usr/local/lib/ruby/gems/1.8/gems/bundler-1.0.12/lib/bundler/runtime.rb:55:in `each'
from /usr/local/lib/ruby/gems/1.8/gems/bundler-1.0.12/lib/bundler/runtime.rb:55:in `require'
from /usr/local/lib/ruby/gems/1.8/gems/bundler-1.0.12/lib/bundler.rb:120:in `require'
from /Users/nelsonwittwer/Sites/simple_cms/config/application.rb:7
from /usr/local/lib/ruby/gems/1.8/gems/railties-3.0.7/lib/rails/commands.rb:28:in `require'
from /usr/local/lib/ruby/gems/1.8/gems/railties-3.0.7/lib/rails/commands.rb:28
from /usr/local/lib/ruby/gems/1.8/gems/railties-3.0.7/lib/rails/commands.rb:27:in `tap'
from /usr/local/lib/ruby/gems/1.8/gems/railties-3.0.7/lib/rails/commands.rb:27
from script/rails:6:in `require'
from script/rails:6
I'm not quite sure where to go from here and would love any help you may have. Thank you.
make sure you have mysql2 gem installed in your ruby system. To check it use gem list -d. If mysql2 gem not found, in ubuntu you must install following library before install mysql2 gem :
# sudo apt-get install libmysqlclient15-dev (for mysql-5.*)
# sudo apt-get install libmysql-ruby ruby-dev
After that, you could install with sudo gem install mysql2 and make sure your adapter value inside database.yml is mysql2. Another issue is Library not loaded, you can view this link if that the problem Library not loaded: libmysqlclient.16.dylib error when trying to run 'rails server' on OS X 10.6 with mysql2 gem
You need the mySQL gem installed on your system.
Now, DO NOT use apt-get to install this, as apt-get often has old versions of the ruby libraries.
Also, I would highly recommend you use SQLite when starting out.
And, Bundler is also very helpful (described in the railstutorial)
On ubuntu/debian based distributions (and you really want to use MySQL):
If you are using ruby 1.8.x (check with ruby -v):
sudo apt-get install libmysqlclient-dev
sudo apt-get install ruby-dev
sudo gem install mysql2
If you are using ruby 1.9.x:
sudo apt-get install libmysqlclient-dev
sudo apt-get install ruby1.9.1-dev
sudo gem install mysql2