I'm following a tutorial of Ruby on rails from this website: https://rails-3-2.railstutorial.org/book/beginning#sec-heroku_setup
and I'm currently stuck at a part where it's telling me to run the command:
rake assets:precompile
It's giving me this error:
/home/myName/.rvm/gems/ruby-1.9.3-p551#rails3tutorial2ndEd/gems/activesupport-3.2.16/lib/active_support/values/time_zone.rb:270: warning: circular argument reference - now
rake aborted!
LoadError: incompatible library version - /home/myName/.rvm/gems/ruby-1.9.3-p551#rails3tutorial2ndEd/gems/sqlite3-1.3.5/lib/sqlite3/sqlite3_native.so
/home/myName/.rvm/gems/ruby-1.9.3-p551#rails3tutorial2ndEd/gems/sqlite3-1.3.5/lib/sqlite3.rb:6:in require' /home/myName/.rvm/gems/ruby-1.9.3-p551#rails3tutorial2ndEd/gems/sqlite3-1.3.5/lib/sqlite3.rb:6:in rescue in <top (required)>'
/home/myName/.rvm/gems/ruby-1.9.3-p551#rails3tutorial2ndEd/gems/sqlite3-1.3.5/lib/sqlite3.rb:2:in <top (required)>' /home/myName/Desktop/rails_projects/first_app/config/application.rb:7:in <top (required)>'
/home/myName/Desktop/rails_projects/first_app/Rakefile:5:in <top (required)>' /home/myName/.rvm/gems/ruby-1.9.3-p551#rails3tutorial2ndEd/gems/rake-12.2.1/exe/rake:27:in <top (required)>'
Caused by:
LoadError: cannot load such file -- sqlite3/2.3/sqlite3_native
/home/myName/.rvm/gems/ruby-1.9.3-p551#rails3tutorial2ndEd/gems/sqlite3-1.3.5/lib/sqlite3.rb:4:in require' /home/myName/.rvm/gems/ruby-1.9.3-p551#rails3tutorial2ndEd/gems/sqlite3-1.3.5/lib/sqlite3.rb:4:in <top (required)>'
/home/myName/Desktop/rails_projects/first_app/config/application.rb:7:in <top (required)>' /home/myName/Desktop/rails_projects/first_app/Rakefile:5:in <top (required)>'
/home/myName/.rvm/gems/ruby-1.9.3-p551#rails3tutorial2ndEd/gems/rake-12.2.1/exe/rake:27:in `<top (required)>'
(See full trace by running task with --trace)
From what I understand of it, I think my sqlite3 is corrupted since I made sure that sqlite3 is installed ("gem list" returns me a list of the gems installed and sqlite 1.3.5 is installed).
I therefor attempted to re-install sqlite3 1.3.5 but no luck in getting it to work. I'm confused on how to resolve the issue, any help is very much appreciated!
Thank you!
I somehow fixed it.
I'm not exactly sure why it worked but it seems like it worked after re-installing bundler.
gem uninstall bundler
gem install bundler
Related
When I am running rake db:create in my ruby on rails project it's giving me error LoadError: incompatible library version - /home/tps/.rvm/gems/ruby-2.3.1/gems/puma-3.6.0/lib/puma/puma_http11.so
Here is full error
tps#tps-H81M-S1:~/sites/my_app$ rake db:create
rake aborted!
LoadError: incompatible library version - /home/tps/.rvm/gems/ruby- 2.3.1/gems/puma-3.6.0/lib/puma/puma_http11.so
/home/tps/.rvm/gems/ruby-2.3.1/gems/puma-3.6.0/lib/puma/server.rb:15:in `require'
/home/tps/.rvm/gems/ruby-2.3.1/gems/puma- 3.6.0/lib/puma/server.rb:15:in `<top (required)>'
/home/tps/.rvm/gems/ruby-2.3.1/gems/puma-3.6.0/lib/puma.rb:14:in `require'
/home/tps/.rvm/gems/ruby-2.3.1/gems/puma-3.6.0/lib/puma.rb:14:in `<top (required)>'
/home/tps/sites/my_app/config/application.rb:7:in `<top (required)>'
/home/tps/sites/my_app/Rakefile:4:in `<top (required)>'
/home/tps/.rvm/gems/ruby-2.3.1/gems/rake-11.3.0/exe/rake:27:in `<top (required)>'
(See full trace by running task with --trace)
Can anyone please help me?
Thanks in advance
Try this(version 3.6.0):
gem uninstall puma
and
bundle
or try this
gem pristine --all
or for specific gem
gem pristine puma
This is my first time learning to code, first time on Linux and first time on stackeroverflow so I dont know if its glaringly obvious where I have gone wrong.
I have followed this guide https://gorails.com/setup/ubuntu/16.04 and everything was working as the guide said until I got to this section:
run bundle install --local
/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require': cannot load such file -- bundler (LoadError)
from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:inrequire'
from /usr/lib/ruby/vendor_ruby/rails/generators/app_base.rb:328:in bundle_command'
from /usr/lib/ruby/vendor_ruby/rails/generators/app_base.rb:344:inrun_bundle'
from (eval):1:in run_bundle'
from /usr/lib/ruby/vendor_ruby/thor/command.rb:27:inrun'
from /usr/lib/ruby/vendor_ruby/thor/invocation.rb:126:in invoke_command'
from /usr/lib/ruby/vendor_ruby/thor/invocation.rb:133:inblock in invoke_all'
from /usr/lib/ruby/vendor_ruby/thor/invocation.rb:133:in each'
from /usr/lib/ruby/vendor_ruby/thor/invocation.rb:133:inmap'
from /usr/lib/ruby/vendor_ruby/thor/invocation.rb:133:in invoke_all'
from /usr/lib/ruby/vendor_ruby/thor/group.rb:232:indispatch'
from /usr/lib/ruby/vendor_ruby/thor/base.rb:440:in start'
from /usr/lib/ruby/vendor_ruby/rails/commands/application.rb:17:in'
from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require'
from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:inrequire'
from /usr/lib/ruby/vendor_ruby/rails/cli.rb:14:in <top (required)>'
from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:inrequire'
from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require'
from /usr/bin/rails:9:in'
tom#Laptop:~$ cd myapp
tom#Laptop:~/myapp$ rake db:create
rake aborted!
LoadError: cannot load such file -- bundler/setup
/home/tom/myapp/config/boot.rb:3:in <top (required)>'
/home/tom/myapp/config/application.rb:1:in'
/home/tom/myapp/Rakefile:4:in <top (required)>'
(See full trace by running task with --trace)
tom#Laptop:~/myapp$ rails server
/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:inrequire': cannot load such file -- bundler/setup (LoadError)
from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require'
from /home/tom/myapp/config/boot.rb:3:in'
from bin/rails:3:in require_relative'
from bin/rails:3:in'
Sorry I don't know how to format this correctly.
When I visit localhost:3000 I just get Network error.
Has anyone got any idea how to solve this? Thanks for your time.
Try gem install bundler. After that use bundle install in terminal.
I'm using Ruby 2.2.2 with Rails 4.2
when i try to run any rake task i have this error message
why is that? and what can i do?
Ruby 2.2.2
Rails 4.2
rbenv
Arch Linux
PostgreSQL database
error message
rake aborted!
LoadError: libncursesw.so.5: cannot open shared object file: No such file or directory - /home/adham/.rbenv/versions/2.2.2/lib/ruby/2.2.0/x86_64-linux/readline.so
/home/adham/.gem/ruby/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in `require'
/home/adham/.gem/ruby/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
/home/adham/.gem/ruby/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in `each'
/home/adham/.gem/ruby/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in `block in require'
/home/adham/.gem/ruby/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `each'
/home/adham/.gem/ruby/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `require'
/home/adham/.gem/ruby/2.2.0/gems/bundler-1.10.6/lib/bundler.rb:134:in `require'
/home/code/kahareb/config/application.rb:7:in `<top (required)>'
/home/code/kahareb/Rakefile:4:in `<top (required)>'
(See full trace by running task with --trace)
I had the same error message while trying to run rails console after last Arch Linux update, and I solved it reinstalling ruby (using rvm). Try the following:
$ rvm reinstall 2.2.2
I setup a new rail application in Netbeans 7.1. Without writing any code, I wanted to see if it just runs but
When clicking run I get errors:
C:/Ruby193/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2/mysql2.rb:2:in `require': 126: The specified module could not be found. - C:/Ruby193/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2/1.9/mysql2.so (LoadError)
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2/mysql2.rb:2:in `<top (required)>'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2.rb:9:in `require'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2.rb:9:in `<top (required)>'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler/runtime.rb:68:in `require'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler/runtime.rb:66:in `each'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler/runtime.rb:66:in `block in require'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler/runtime.rb:55:in `each'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler/runtime.rb:55:in `require'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler.rb:119:in `require'
from C:/_PROJECTS/active/Callisto2.0/config/application.rb:7:in `<top (required)>'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/commands.rb:53:in `require'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/commands.rb:53:in `block in <top (required)>'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/commands.rb:50:in `tap'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
I've installed a few gems it was complaining about through netbeans gem manager but I got stuck at mysql2. Even though I installed mysql and mysql2 gems, it still won't find it.
With little research, it seems i have to do a bundle install, for WEBrick to run/ check dependencies or whatever. Netbeans project has a Bundler context menu with options for check, init, install, show etc.
None of those produce any output in the Output: Bundler window. The Bundler process starts in netbeans processes but then quits after a second. No errors, info or anything.
What do I need to do to get this working. This is a blank Ruby/Rails Application through Netbeans 7.1.
EDIT 1:
The error in file: C:/Ruby193/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2/mysql2.rb:2 contains the following lines:
RUBY_VERSION =~ /(\d+.\d+)/
require "mysql2/#{$1}/mysql2"
Nothing Special. I tried changing that to mysql, or just "mysql2", it doesn't work. Errors that client is not initialized when I comment the whole line.
Netbeans stopped supporting rails. See :
Ruby Dropped in Netbeans 7,How to Use it in Netbeans7?
And:
http://noteslog.com/post/netbeans-6-9-1-ruby-1-9-2-rails-3-0-0-mysql-gem-2-8-1/
Did you get a message that your user is not allowed to install gems?
Then you should try following command in your rails application root folder
bundle install --path vendor/bundle
make sure to have the configurated database.yml in the config folder before running the previous command, or run it again after creating the file.
I've downloaded and installed "rubyinstaller-1.9.2-p180.exe", then I installed gems(rubygems-1.6.2 by running 'ruby setup.rb') and the installed rails by running 'gem install rails'.
After doing all this, I've downloaded and installed RubyMine 3.1
In RubyMine I try to create new 'Rails Application' project, in the 'Rails application settings' dialog it shows above installed rub as the Ruby Interpreter, Rails Version says '3.0.5'. Rails Template is empty. 'Preconfigure for selected databases' is unchecked, and also "skip test:unit files' is unchecked.
After clicking ok, it creates some files at the top of the code there is a message "some of the required getms are note attached: sqlite3"( I didn't ask DB, so why sqlite??) anyway I click, on 'attach gems'.
After that I click on play icon, and get below errors. Please help me resolve this issues. Thanks in advance!
------------------------------
C:\Ruby192\bin\ruby.exe -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) C:/Users/kobi/RubymineProjects/deded/script/rails server -b 127.0.0.1 -p 3000 -e development
C:/Ruby192/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.3-x86-mingw32/lib/sqlite3.rb:6:in `require': no such file to load -- sqlite3/sqlite3_native (LoadError)
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.3-x86-mingw32/lib/sqlite3.rb:6:in `rescue in <top (required)>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.3-x86-mingw32/lib/sqlite3.rb:2:in `<top (required)>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/runtime.rb:68:in `require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/runtime.rb:66:in `each'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/runtime.rb:66:in `block in require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/runtime.rb:55:in `each'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/runtime.rb:55:in `require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler.rb:120:in `require'
from C:/Users/kobi/RubymineProjects/deded/config/application.rb:7:in `<top (required)>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.5/lib/rails/commands.rb:28:in `require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.5/lib/rails/commands.rb:28:in `block in <top (required)>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.5/lib/rails/commands.rb:27:in `tap'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.5/lib/rails/commands.rb:27:in `<top (required)>'
from C:/Users/kobi/RubymineProjects/deded/script/rails:6:in `require'
from C:/Users/kobi/RubymineProjects/deded/script/rails:6:in `<top (required)>'
from -e:1:in `load'
from -e:1:in `<main>'
Process finished with exit code 1
RubyInstaller for Ruby 1.9.2 doesn't support any other RubyGems version except the one which comes with the RubyInstaller. By updating RubyGems you break your Ruby installation. Please reinstall Ruby into the clean directory and don't update RubyGems.
Also, it looks like sqlite3.dll is missing from your PATH environment. Download it and unpack into RUBY_HOME\bin or c:\windows\system32. Rails needs some database and sqlite is the default.
Some native gem extensions may require DevKit installed, if you have problems installing such gems, install DevKit first.
Try this from console:
cd C:/users/kobi/rubymineprojects/deded
bundle install