heroku create fatal error unable to remap - ruby-on-rails-3

On Windows 7 machine, using cygwin ruby 1.92, rails 3.1.3.
I run the heroku create and get the following error message:
heroku create
Creating growing-journey-1774... done, stack is bamboo-mri-1.9.2
http://growing-journey-1774.heroku.com/ | git#heroku.com:growing-journey-1774.git
1 [main] ruby 4292 C:\cygwin\usr\local\bin\ruby.exe: *** fatal error - unable to remap \\?\C:\cygwin\usr\local\lib\ruby\1.9.1\i386-cygwin\etc.so to same address as parent: 0x3E0000 != 0x3F0000
Stack trace:
Frame Function Args
0028A778 6102796B (0028A778, 00000000, 00000000, 00000000)
0028AA68 6102796B (6117EC60, 00008000, 00000000, 61180977)
0028BA98 61004F1B (611A7FAC, 61248A3C, 003E0000, 003F0000)
End of stack trace
1 [main] ruby 2856 fork: child 4292 - died waiting for dll loading, errno 11
1086458 [main] ruby 2944 C:\cygwin\usr\local\bin\ruby.exe: *** fatal error - unable to remap \\?\C:\cygwin\usr\local\lib\ruby\1.9.1\i386-cygwin\etc.so to same address as parent: 0x3E0000 != 0x410000
Stack trace:
Frame Function Args
0028A778 6102796B (0028A778, 00000000, 00000000, 00000000)
0028AA68 6102796B (6117EC60, 00008000, 00000000, 61180977)
0028BA98 61004F1B (611A7FAC, 61248A3C, 003E0000, 00410000)
End of stack trace
1098573 [main] ruby 2856 fork: child 2944 - died waiting for dll loading, errno 11
I was able to upload the SSH keys to heroku just fine in the previous step.
Any ideas? My research hasn't led me anywhere. Appreciate anybody's help!
My Gem env shows:
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.12
- RUBY VERSION: 1.9.2 (2011-07-09 patchlevel 290) [i386-cygwin]
- INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/1.9.1
- RUBY EXECUTABLE: /usr/local/bin/ruby.exe
- EXECUTABLE DIRECTORY: /usr/local/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-cygwin
- GEM PATHS:
- /usr/local/lib/ruby/gems/1.9.1
- /home/Philip/.gem/ruby/1.9.1
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/

Your problem looks like more with Ruby or Cygwin setup and less with Heroku, try following link solution
http://redmine.jamoma.org/projects/jamoma/wiki/Setting_up_development_environment_in_Windows

Related

Rails 5 Server Issues (Windows 10)

Newbie to Ruby on Rails here, I just did a fresh install of Ruby & Rails on Windows 10 (Bash on Ubuntu shell). I seems to having issues on starting the Rails server. Already checked the other threads on the issue, but everyone else is using OSX. :( Hope someone can help!
When running rails s,
root#TEAMROCKETHQ:~/newapp# rails s
/root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/railties-5.0.2/lib/rails/app_loader.rb:40: warning: Insecure world writable dir /root/.rbenv/versions in PATH, mode 040777
=> Booting Puma
=> Rails 5.0.2 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
Puma starting in single mode...
* Version 3.8.0 (ruby 2.4.0-p0), codename: Sassy Salamander
* Min threads: 5, max threads: 5
Environment: development
* Listening on tcp://localhost:3000
Use Ctrl-C to stop
For the first line issue, I tried:
sudo chmod 775 /usr/local
it seems it didn't do anything. Maybe I'm reading the error wrong, but I don't know... When I go to localhost:3000, it returns this error:
=> Booting Puma
=> Rails 5.0.2 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
Puma starting in single mode...
* Version 3.8.0 (ruby 2.4.0-p0), codename: Sassy Salamander
* Min threads: 5, max threads: 5
Environment: development
* Listening on tcp://localhost:3000
Use Ctrl-C to stop
2017-03-09 23:17:26 -0600: Read error: #<Errno::EINVAL: Invalid argument - getsockopt(2)>
/root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/puma-3.8.0/lib/puma/server.rb:124:in `getsockopt'
/root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/puma-3.8.0/lib/puma/server.rb:124:in `closed_socket?'
/root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/puma-3.8.0/lib/puma/server.rb:563:in `handle_request'
/root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/puma-3.8.0/lib/puma/server.rb:425:in `process_client'
/root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/puma-3.8.0/lib/puma/server.rb:289:in `block in run'
/root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/puma-3.8.0/lib/puma/thread_pool.rb:120:in `block in spawn_thread'
Webpage:
The localhost page isn't working
localhost is currently unable to handle this request.
HTTP ERROR 500
It is because puma 3.8.0.
Put gem 'puma', '3.7.1' in your gem file, and bundle install again.
And gem uninstall puma at version 3.8.0, wait until there is a fix.

Mechanize getting "Errno::ECONNRESET: Connection reset by peer - SSL_connect"

I'm unable to get Mechanize to load a page that used to work -- it's reliably failing with a Errno: ECONNRESET: Connection reset by peer - SSL_connect message. Any suggestions as to what I should try or details I should look at? (Please see "what I've tried" below...)
Update 1
Taking a hint from a related S.O. post, I tried accessing the site directly with Net::HTTP. When I set http.ssl_version = :TLSv1, I get a redirect rather than an error (as it should be). So my question becomes: how can I configure Net::HTTP's underlying ssl_version parameters from within Mechanize?
Thanks...
The symptoms:
$ rails console
>> a = Mechanize.new
=> #<Mechanize:0x007fd26789b8e0 ...>
>> p = a.get("http://sce.com")
# (...after a long pause...)
Errno::ECONNRESET: Connection reset by peer - SSL_connect
from /sandbox/usr/lib/ruby/2.0.0/net/http.rb:918:in `connect'
from /sandbox/usr/lib/ruby/2.0.0/net/http.rb:918:in `block in connect'
from /sandbox/usr/lib/ruby/2.0.0/timeout.rb:52:in `timeout'
from /sandbox/usr/lib/ruby/2.0.0/net/http.rb:918:in `connect'
from /sandbox/usr/lib/ruby/2.0.0/net/http.rb:862:in `do_start'
from /sandbox/usr/lib/ruby/2.0.0/net/http.rb:857:in `start'
from /sandbox/usr/lib/ruby/gems/2.0.0/gems/net-http-persistent-2.9/lib/net/http/persistent.rb:691:in `start'
from /sandbox/usr/lib/ruby/gems/2.0.0/gems/net-http-persistent-2.9/lib/net/http/persistent.rb:631:in `connection_for'
...
from /sandbox/usr/lib/ruby/gems/2.0.0/gems/mechanize-2.7.2/lib/mechanize/http/agent.rb:257:in `fetch'
from /sandbox/usr/lib/ruby/gems/2.0.0/gems/mechanize-2.7.2/lib/mechanize/http/agent.rb:974:in `response_redirect'
from /sandbox/usr/lib/ruby/gems/2.0.0/gems/mechanize-2.7.2/lib/mechanize/http/agent.rb:298:in `fetch'
from /sandbox/usr/lib/ruby/gems/2.0.0/gems/mechanize-2.7.2/lib/mechanize.rb:432:in `get'
from (irb):3
The environment:
$ rake about
About your application's environment
Ruby version 2.0.0 (x86_64-darwin12.4.0)
RubyGems version 2.1.9
Rack version 1.5
Rails version 4.0.0
JavaScript Runtime JavaScriptCore
Active Record version 4.0.0
Action Pack version 4.0.0
Action Mailer version 4.0.0
Active Support version 4.0.0
Middleware ActionDispatch::Static, Rack::Lock, #<ActiveSupport::Cache::Strategy::LocalCache::Middleware:0x007ffd423c50e0>, Rack::Runtime, Rack::MethodOverride, ActionDispatch::RequestId, Rails::Rack::Logger, ActionDispatch::ShowExceptions, ActionDispatch::DebugExceptions, ActionDispatch::RemoteIp, ActionDispatch::Reloader, ActionDispatch::Callbacks, ActiveRecord::Migration::CheckPending, ActiveRecord::ConnectionAdapters::ConnectionManagement, ActiveRecord::QueryCache, ActionDispatch::Cookies, ActionDispatch::Session::CookieStore, ActionDispatch::Flash, ActionDispatch::ParamsParser, Rack::Head, Rack::ConditionalGet, Rack::ETag
Application root /Users/me/MyProject
Environment development
Database adapter postgresql
Database schema version 20131017201057
$ openssl version
OpenSSL 1.0.1e 11 Feb 2013
$ system_profiler -detailLevel mini SPSoftwareDataType
System Software Overview:
System Version: OS X 10.8.5 (12F45)
Kernel Version: Darwin 12.5.0
Time since boot: 8 days 7:40
What I've tried:
I've tried the same URL from a Firefox web browser. It works.
I've explicitly set the Mechanize request_headers to exactly mimic the Firefox browser. No change.
I've updated my ssl/cert.pem file (a second time) as described in this S.O post. No change.
I've tried different sites: www.pge.com and www.sdge.com. Both work. There's something different about the www.sce.com site.
Success with Net::HTTP
Here's an example of Net::HTTP working:
$ irb
>> require 'net/https'
=> true
>> require 'uri'
=> false
>> uri = URI.parse("https://www.sce.com/")
=> #<URI::HTTPS:0x007facab8f6ba0 URL:https://www.sce.com/>
>> http = Net::HTTP.new(uri.host, uri.port)
=> #<Net::HTTP www.sce.com:443 open=false>
>> http.use_ssl = true
=> true
>> http.ssl_version = :TLSv1 # <= this line makes all the difference
=> :TLSv1
>> r = http.start { |agent| p agent.get(uri.path) }
=> #<Net::HTTPFound 302 Found readbody=true>
>> r.to_hash
=> {"content-language"=>["en-US"], "date"=>["Fri, 18 Oct 2013 01:00:07 GMT"], "location"=>["https://www.sce.com/wps/portal/home/!ut/p/b1/04_Sj9CPykssy0xPLMnMz0vMAfGjzOIt3Q1cPbz8DTzdQwKNDTyNAw38gh0djQ0MzIAKIoEKDHAARwNC-sP1o8BK8Jjg55Gfm6pfkBthoOuoqAgAgIrzaA!!/dl4/d5/L2dBISEvZ0FBIS9nQSEh/"], "p3p"=>["CP=\"NON CUR OTPi OUR NOR UNI\""], "server"=>["IBM_HTTP_Server"], "transfer-encoding"=>["chunked"], "x-powered-by"=>["Servlet/3.0"], "set-cookie"=>["PD_STATEFUL_d55ece64-8d9a-11e2-84a1-0050560010d6=%2Fwps; Path=/", "session_www=740796608.47873.0000; path=/"]}
The folks on the Mechanize mailing list kindly provided the answer:
agent = Mechanize.new do |a|
a.ssl_version = :TLSv1
end

Rails 3.0, RVM: still getting "Could not find ... in any of the sources (Bundler::GemNotFound)"

I have following (and have shortened the full path to "/.../"):
$ gem environment
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.21
- RUBY VERSION: 1.9.2 (2012-02-14 patchlevel 318) [x86_64-linux]
- INSTALLATION DIRECTORY: /.../.rvm/gems/ruby-1.9.2-p318#rails-3.0
- RUBY EXECUTABLE: /.../.rvm/rubies/ruby-1.9.2-p318/bin/ruby
- EXECUTABLE DIRECTORY: /.../.rvm/gems/ruby-1.9.2-p318#rails-3.0/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /.../.rvm/gems/ruby-1.9.2-p318#rails-3.0
- /.../.rvm/gems/ruby-1.9.2-p318#global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
As you can see I have #global and #rails-3.0 gemsets. Passenger 3.0.11 is installed in the #global gemset, and I have a .rmvrc file in my application root:
rvm ruby-1.9.2-p318#rails-3.0
However, after running $ bundle install and restarting the app via $ touch tmp/restart.txt I keep getting the Passenger error screen with the following:
Error message: Could not find aaronh-chronic-0.3.9 in any of the sources (Bundler::GemNotFound)
This gem is installed in the #rails-3.0 gemset
Gemfile here.
$ gem list here
If I install the aaronh-chronic gem in the #global gemset, then it just complains about the next one in line. It's like it is only checking the #global gemset instead of first looking in my #rails-3.0 gemset. How can I get it to use both gemsets? (Full backtrace here.)
UPDATE: Here is my Passenger Apache configuration:
# In /etc/apache2/mods_available/passenger.load
LoadModule passenger_module /.../.rvm/gems/ruby-1.9.2-p318#global/gems/passenger-3.0.11/ext/apache2/mod_passenger.so
# In /etc/apache2/mods_available/passenger.conf
<IfModule mod_passenger.c>
PassengerRoot /.../.rvm/gems/ruby-1.9.2-p318#global/gems/passenger-3.0.11
PassengerRuby /.../.rvm/wrappers/ruby-1.9.2-p318#global/ruby
</IfModule>
Try bundle update and gem update --system.

"rails server" not working

I am using window 7.
I have upgraded rails 2.0.2 to rails 3.0.9 with ruby as 1.8.7. I have changed in evironment.rb as:
RAILS_GEM_VERSION = '3.0.9' unless defined? RAILS_GEM_VERSION
still I am unable to start server.
RubyGems Environment:
- RUBYGEMS VERSION: 1.7.2
- RUBY VERSION: 1.8.7 (2011-06-30 patchlevel 352) [i386-mingw32]
- INSTALLATION DIRECTORY: C:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8
- RUBY EXECUTABLE: C:/InstantRails-2.0-win/ruby/bin/ruby.exe
- EXECUTABLE DIRECTORY: C:/InstantRails-2.0-win/ruby/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-mingw32
- GEM PATHS:
- C:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8
- C:/Users/SUKETA/.gem/ruby/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- :sources => ["http://gems.github.com", "http://rubygems.org/"]
- REMOTE SOURCES:
- http://gems.github.com
- http://rubygems.org/
Any suggestion
Maybe it can help you:
http://railscasts.com/episodes/225-upgrading-to-rails-3-part-1
Is part of a complete guide that explain how to do this migration on the right way.
However according to http://weblog.rubyonrails.org/2010/9/4/ruby-on-rails-2-3-9-released (official Rails blog) it is recommended to first migrate to Rails 2.3.9
Migrating from rails 2.0.2 to Rails 3 isn't exactly a simple task. To give you an idea Ryan Bates made 3 screencast about this. You can find out more here; http://railscasts.com/episodes/225-upgrading-to-rails-3-part-1

Ubuntu RVM install issue rvm_ruby_src_path not set

Following instructions from http://web2linux.com/installing-rails-3-on-ubuntu-10-04-lucid-lynx/ I get to the following line:
rvm install 1.9.2
returns:
ruby-1.9.2-p0 - #fetching
ruby-1.9.2-p0 - #extracting ruby-1.9.2-p0 to
mv: cannot move `/tmp/rvm_src_18035/ruby-1.9.2-p0' to `': No such file or directory
~/.rvm/scripts/manage: line 1237: ruby-1.9.2-p0 - #extracted to : command not found
Running autoconf
Error running 'autoconf', please check ~/.rvm/log/ruby-1.9.2-p0/autoconf*.log
Skipping configure step, 'configure' does not exist, did autoconf not run successfully?
ruby-1.9.2-p0 - #compiling
Error running 'make ', please check ~/.rvm/log/ruby-1.9.2-p0/make*.log
There has been an error while running make. Halting the installation.
looking at .rvm/scripts/manage it seems that $rvm_ruby_src_path is not set. Am I missing anything in my setup? Below are more details on my environment:
$ rvm info
system:
system:
uname: "Linux host 2.6.32-24-generic #42-Ubuntu SMP Fri Aug 20 14:21:58 UTC 2010 x86_64 GNU/Linux"
bash: "/bin/bash => GNU bash, version 4.1.5(1)-release (x86_64-pc-linux-gnu)"
zsh: " => not installed"
rvm:
version: "rvm 1.0.7 by Wayne E. Seguin (wayneeseguin#gmail.com) [http://rvm.beginrescueend.com/]"
homes:
gem: "not set"
ruby: "not set"
binaries:
ruby: "/usr/bin/ruby"
irb: "/usr/bin/irb"
gem: "/usr/bin/gem"
rake: "/usr/bin/rake"
environment:
PATH: "~/.rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
GEM_HOME: ""
GEM_PATH: ""
BUNDLE_PATH: ""
MY_RUBY_HOME: ""
IRBRC: ""
RUBYOPT: ""
gemset: ""
$ ruby -v
ruby 1.8.7 (2010-01-10 patchlevel 249) [x86_64-linux
$ gem environment
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.7
- RUBY VERSION: 1.8.7 (2010-01-10 patchlevel 249) [x86_64-linux]
- INSTALLATION DIRECTORY: /usr/lib/ruby/gems/1.8
- RUBY EXECUTABLE: /usr/bin/ruby1.8
- EXECUTABLE DIRECTORY: /usr/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /usr/lib/ruby/gems/1.8
- ~/.gem/ruby/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- "gem" => "--no-ri --no-rdoc"
- REMOTE SOURCES:
- http://rubygems.org/
I just reinstalled my mac, and got the same problem.
Edit: after I run rvm update && rvm reload, it works!