Cannot Start Up Rails 4 Server - ruby-on-rails

Getting this when I attempt to run "rails s"
/Users/JustinLonas/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require': dlopen(/Users/JustinLonas/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/x86_64-darwin13.0.0/digest/sha1.bundle, 9): Library not loaded: /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib (LoadError)
Referenced from: /Users/JustinLonas/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/x86_64-darwin13.0.0/digest/sha1.bundle
Reason: image not found - /Users/JustinLonas/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/x86_64-darwin13.0.0/digest/sha1.bundle
from /Users/JustinLonas/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/JustinLonas/.rvm/gems/ruby-1.9.3-p327#global/gems/bundler-1.5.2/lib/bundler/definition.rb:1:in `<top (required)>'
from /Users/JustinLonas/.rvm/gems/ruby-1.9.3-p327#global/gems/bundler-1.5.2/lib/bundler.rb:152:in `definition'
from /Users/JustinLonas/.rvm/gems/ruby-1.9.3-p327#global/gems/bundler-1.5.2/lib/bundler.rb:115:in `setup'
from /Users/JustinLonas/.rvm/gems/ruby-1.9.3-p327#global/gems/bundler-1.5.2/lib/bundler/setup.rb:7:in `<top (required)>'
from /Users/JustinLonas/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:135:in `require'
from /Users/JustinLonas/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:135:in `rescue in require'
from /Users/JustinLonas/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:144:in `require'
from /Users/JustinLonas/projects/gohobbyist/config/boot.rb:4:in `<top (required)>'
from bin/rails:3:in `require_relative'
from bin/rails:3:in `<main>'

I actually fixed this issue. I reinstalled homebrew and downloaded the yosemite CLI tools and everything just worked after that.

Related

Rails Server Error - Rails 4

I am trying to come back to create another application on Rail4 and When I try to start the application this is what happened:
prompt$ rails server
/Users/ec/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/mysql2-0.4.5/lib/mysql2.rb:31:in `require': dlopen(/Users/ec/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/mysql2-0.4.5/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib (LoadError)
Referenced from: /Users/edwincaro/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/mysql2-0.4.5/lib/mysql2/mysql2.bundle
Reason: image not found - /Users/edwincaro/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/mysql2-0.4.5/lib/mysql2/mysql2.bundle
from /Users/ec/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/mysql2-0.4.5/lib/mysql2.rb:31:in `<top (required)>'
from /Users/ec/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/bundler-1.6.2/lib/bundler/runtime.rb:76:in `require'
from /Users/ec/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/bundler-1.6.2/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from /Users/ec/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/bundler-1.6.2/lib/bundler/runtime.rb:72:in `each'
from /Users/ec/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/bundler-1.6.2/lib/bundler/runtime.rb:72:in `block in require'
from /Users/ec/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/bundler-1.6.2/lib/bundler/runtime.rb:61:in `each'
from /Users/ec/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/bundler-1.6.2/lib/bundler/runtime.rb:61:in `require'
from /Users/ec/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/bundler-1.6.2/lib/bundler.rb:132:in `require'
from /Users/ec/Sites/ticketsys/config/application.rb:7:in `<top (required)>'
from /Users/ec/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/commands.rb:76:in `require'
from /Users/ec/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/commands.rb:76:in `block in <top (required)>'
from /Users/ec/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/commands.rb:73:in `tap'
from /Users/ec/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/commands.rb:73:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
prompt$
I read all the 'Rails Server Error' posted previously here and tried most of the solution offered here but none of them worked for me.
I am thinking that maybe is the file dlopen what I am missing.
I will appreciate any help please
You need to reinstall your mysql library. Then:
gem uninstall mysql2
bundle install
To rebuild the gem against the new mysql library

Symbol not found: _SSLv2_client_method (LoadError)

When i try to run the server it gives the following error
/Users/brijesh/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/openssl.rb:17:in `require': dlopen(/Users/brijesh/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/x86_64-darwin12.5.0/openssl.bundle, 9): Symbol not found: _SSLv2_client_method (LoadError)
Referenced from: /Users/brijesh/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/x86_64-darwin12.5.0/openssl.bundle
Expected in: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
in /Users/brijesh/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/x86_64-darwin12.5.0/openssl.bundle - /Users/brijesh/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/x86_64-darwin12.5.0/openssl.bundle
from /Users/brijesh/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/openssl.rb:17:in `<top (required)>'
from /Users/brijesh/.rvm/gems/ruby-2.0.0-p353/gems/activesupport-4.1.4/lib/active_support/key_generator.rb:2:in `require'
from /Users/brijesh/.rvm/gems/ruby-2.0.0-p353/gems/activesupport-4.1.4/lib/active_support/key_generator.rb:2:in `<top (required)>'
from /Users/brijesh/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.1.4/lib/rails/application.rb:4:in `require'
from /Users/brijesh/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.1.4/lib/rails/application.rb:4:in `<top (required)>'
from /Users/brijesh/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.1.4/lib/rails.rb:11:in `require'
from /Users/brijesh/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.1.4/lib/rails.rb:11:in `<top (required)>'
from /Users/brijesh/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.1.4/lib/rails/commands/server.rb:4:in `require'
from /Users/brijesh/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.1.4/lib/rails/commands/server.rb:4:in `<top (required)>'
from /Users/brijesh/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:128:in `require'
from /Users/brijesh/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:128:in `require_command!'
from /Users/brijesh/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:74:in `server'
from /Users/brijesh/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
from /Users/brijesh/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.1.4/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
After looking at the suggestion in this
Ruby Bundle Symbol not found: _SSLv2_client_method (LoadError)
the problem is solved. But after restarting the computer i have to again go through the same procedure that is to do get stable rvm and reinstall the ruby again.
Another thing i noticed was after restarting and opening the terminal it starts with the following error:
/Users/brijesh/.rvm/scripts/initialize:48: __rvm_cleanse_variables: function definition file not found
I am not sure what is going on and have been stuck in this for this long. I would really appreciate the help.
You probably need to set the correct ruby version on your project using your ruby version manager
rvm --default 'ruby-version'
Let me know if that works

heroku pg:psql error: cannot load such file -- dl/import (LoadError)

I am trying to access my production postgresql database on heroku using the following command from a windows command line:
> heroku pg:psql
However, I am getting the below error. I made sure that net-ssh is included in my gemfile with gem 'net-ssh', '2.9.3.beta1', then I deleted gemfile.lock, and re-deployed. Any help is appreciated!
---> Connecting to DATABASE_URL
C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- dl/import (LoadError)
from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from C:/Users/user/.heroku/client/vendor/gems/net-ssh-2.9.2/lib/net/ssh/authentication/pageant.rb:1:in `<top (required)>'
from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from C:/Users/user/.heroku/client/vendor/gems/net-ssh-2.9.2/lib/net/ssh/authentication/agent/socket.rb:5:in `<top (required)>'
from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from C:/Users/user/.heroku/client/vendor/gems/net-ssh-2.9.2/lib/net/ssh/authentication/agent.rb:22:in `<top (required)>'
from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from C:/Users/user/.heroku/client/vendor/gems/net-ssh-2.9.2/lib/net/ssh/authentication/key_manager.rb:4:in `<top (required)>'
from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from C:/Users/user/.heroku/client/vendor/gems/net-ssh-2.9.2/lib/net/ssh/authentication/session.rb:4:in `<top (required)>'
from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from C:/Users/user/.heroku/client/vendor/gems/net-ssh-2.9.2/lib/net/ssh.rb:11:in `<top (required)>'
from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from C:/Users/user/.heroku/client/vendor/gems/net-ssh-gateway-1.2.0/lib/net/ssh/gateway.rb:2:in `<top (required)>'
from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from C:/Users/user/.heroku/client/lib/heroku/helpers/heroku_postgresql.rb:54:in `maybe_tunnel'
from C:/Users/user/.heroku/client/lib/heroku/command/pg.rb:150:in `psql'
from C:/Users/user/.heroku/client/lib/heroku/command.rb:212:in `run'
from C:/Users/user/.heroku/client/lib/heroku/cli.rb:30:in `start'
from C:/Heroku/bin/heroku:29:in `<main>'
I figured it out. It had something to do with a version of Ruby that I installed after I installed the Heroku toolbelt. So I just uninstalled and reinstalled the Heroku toolbelt like so:
Go to Add / Remove Programs and uninstall the Heroku Toolbelt
Install the Heroku Toolbelt from https://toolbelt.heroku.com/
Type in heroku in a command line to install the toolbelt
I hope this helps someone.

Unable to open the rails console

Unable to open the rails console, throws the following error
$ rails c
/home/#/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/irb/completion.rb:9:in `require': cannot load such file -- readline (LoadError)
from /home/#/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/irb/completion.rb:9:in `<top (required)>'
from /home/#/.rvm/gems/ruby-2.0.0-p0#aer-ui/gems/railties-3.2.13/lib/rails/commands/console.rb:3:in `require'
from /home/#/.rvm/gems/ruby-2.0.0-p0#aer-ui/gems/railties-3.2.13/lib/rails/commands/console.rb:3:in `<top (required)>'
from /home/#/.rvm/gems/ruby-2.0.0-p0#aer-ui/gems/railties-3.2.13/lib/rails/commands.rb:38:in `require'
from /home/#/.rvm/gems/ruby-2.0.0-p0#aer-ui/gems/railties-3.2.13/lib/rails/commands.rb:38:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
You need to have the readline libraries installed when you compile Ruby.
Follow this blog:
fixing-readline-for-the-ruby-on-rails-console

Rails Installation problems (Mac 10.7)

I just installed ruby using homebrew and performed a gem install of rails.
While it says that rails has been installed, when i type in rails on terminal i get the following output :
/Users/moveablecode/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require': dlopen(/Users/moveablecode/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/x86_64-darwin11.4.0/digest/md5.bundle, 9): Library not loaded: /opt/local/lib/libcrypto.1.0.0.dylib (LoadError)
Referenced from: /Users/moveablecode/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/x86_64-darwin11.4.0/digest/md5.bundle
Reason: image not found - /Users/moveablecode/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/x86_64-darwin11.4.0/digest/md5.bundle
from /Users/moveablecode/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
from /Users/moveablecode/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/generators/app_base.rb:1:in `<top (required)>'
from /Users/moveablecode/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
from /Users/moveablecode/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
from /Users/moveablecode/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/generators/rails/app/app_generator.rb:1:in `<top (required)>'
from /Users/moveablecode/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
from /Users/moveablecode/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
from /Users/moveablecode/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/commands/application.rb:24:in `<top (required)>'
from /Users/moveablecode/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
from /Users/moveablecode/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
from /Users/moveablecode/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/cli.rb:15:in `<top (required)>'
from /Users/moveablecode/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
from /Users/moveablecode/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
from /Users/moveablecode/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/bin/rails:7:in `<top (required)>'
from /Users/moveablecode/.rvm/gems/ruby-1.9.3-p392/bin/rails:19:in `load'
from /Users/moveablecode/.rvm/gems/ruby-1.9.3-p392/bin/rails:19:in `<main>'
from /Users/moveablecode/.rvm/gems/ruby-1.9.3-p392/bin/ruby_noexec_wrapper:14:in `eval'
from /Users/moveablecode/.rvm/gems/ruby-1.9.3-p392/bin/ruby_noexec_wrapper:14:in `<main>'
Any solution to fix these errors?
try to use railsinstaller. download it from http://railsinstaller.org/
and follow steps from http://pragmaticstudio.com/blog/2010/9/23/install-rails-ruby-mac it will more helpful for you.This is easiest way to install rails

Resources