{"action":"created","issue":{"url":"https://api.github.com/repos/padrino/padrino-framework/issues/2097","repository_url":"https://api.github.com/repos/padrino/padrino-framework","labels_url":"https://api.github.com/repos/padrino/padrino-framework/issues/2097/labels{/name}","comments_url":"https://api.github.com/repos/padrino/padrino-framework/issues/2097/comments","events_url":"https://api.github.com/repos/padrino/padrino-framework/issues/2097/events","html_url":"https://github.com/padrino/padrino-framework/issues/2097","id":191836314,"number":2097,"title":"Anyone meet segment fault 11 on mac when run padrino command","user":{"login":"grasp","id":28118,"avatar_url":"https://avatars.githubusercontent.com/u/28118?v=3","gravatar_id":"","url":"https://api.github.com/users/grasp","html_url":"https://github.com/grasp","followers_url":"https://api.github.com/users/grasp/followers","following_url":"https://api.github.com/users/grasp/following{/other_user}","gists_url":"https://api.github.com/users/grasp/gists{/gist_id}","starred_url":"https://api.github.com/users/grasp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grasp/subscriptions","organizations_url":"https://api.github.com/users/grasp/orgs","repos_url":"https://api.github.com/users/grasp/repos","events_url":"https://api.github.com/users/grasp/events{/privacy}","received_events_url":"https://api.github.com/users/grasp/received_events","type":"User","site_admin":false},"labels":[{"id":27053414,"url":"https://api.github.com/repos/padrino/padrino-framework/labels/revalidate","name":"revalidate","color":"ededed","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2016-11-27T01:28:47Z","updated_at":"2016-12-07T03:57:39Z","closed_at":null,"body":"#### Do you want to request a *feature* or report a *bug*?\r\nBug\r\n#### What is the current behavior?\r\n\r\nRun any of padrino command , it will be segment fault 11.\r\nSegmentation fault: 11\r\n\r\nI have raised a issue to ruby.\r\nhttps://bugs.ruby-lang.org/issues/12982\r\n\r\n\r\n#### Which versions of Ruby, Padrino, Sinatra, Rack, OS are you using? Did this work in previous versions?\r\n\r\nruby 2.2, 2.3\r\npadrino 0.13.3\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/padrino/padrino-framework/issues/comments/265349203","html_url":"https://github.com/padrino/padrino-framework/issues/2097#issuecomment-265349203","issue_url":"https://api.github.com/repos/padrino/padrino-framework/issues/2097","id":265349203,"user":{"login":"adam12","id":17083,"avatar_url":"https://avatars.githubusercontent.com/u/17083?v=3","gravatar_id":"","url":"https://api.github.com/users/adam12","html_url":"https://github.com/adam12","followers_url":"https://api.github.com/users/adam12/followers","following_url":"https://api.github.com/users/adam12/following{/other_user}","gists_url":"https://api.github.com/users/adam12/gists{/gist_id}","starred_url":"https://api.github.com/users/adam12/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adam12/subscriptions","organizations_url":"https://api.github.com/users/adam12/orgs","repos_url":"https://api.github.com/users/adam12/repos","events_url":"https://api.github.com/users/adam12/events{/privacy}","received_events_url":"https://api.github.com/users/adam12/received_events","type":"User","site_admin":false},"created_at":"2016-12-07T03:57:38Z","updated_at":"2016-12-07T03:57:38Z","body":"@grasp \r\n\r\nI'm able to temporarily fix the segfaults by changing the last line of your `bin/padrino` command to be:\r\n\r\n```ruby\r\nload Gem.bin_path(\"padrino-core\", \"padrino\")\r\n```\r\n\r\nWhat I believe is happening is that Bundler looks at the `gemspec` for your project, specifically the `executables` line, which is the list of files in `bin/`. It then writes out binstubs for each of those files, clobbering the proper binstubs with it's own broken version.\r\n\r\nWhen Bundler generates a binstub with the line above, it normally puts the name of the Gem as it's first argument (`padrino-core`, `haml`, etc). In this instance it's mistakenly changing it to `new_talk` for all your binstubs.\r\n\r\nWhen you run your `padrino` command, it loads the binstub, which incorrectly loads itself repeatedly.\r\n\r\nYou can solve this permanently by changing `new_talk.gemspec`'s executable line to the following:\r\n\r\n```ruby\r\ngem.executables   = [\"new_talk\"]\r\n```\r\n\r\nAnd re-running `bundle --binstubs`.\r\n\r\nThat said, your `bin/new_talk` binstub is still broken. It should look something like this:\r\n\r\n```ruby\r\n#!/usr/bin/env ruby\r\n\r\nDir.chdir(File.dirname(__FILE__)+'/..')\r\n\r\n# Start the app with Padrino::Server\r\nrequire 'bundler/setup'\r\nrequire 'padrino-core/cli/launcher'\r\n\r\nARGV.unshift('start') if ARGV.first.nil? || ARGV.first.start_with?('-')\r\nPadrino::Cli::Launcher.start ARGV\r\n\r\n# Start the app with Rack::Server\r\n#require \"rack\"\r\n#Rack::Server.start\r\n```\r\n\r\nSeems like some of the ideal advise is to move Gem specific bin's to the `exe` folder (https://github.com/bundler/bundler-features/issues/105 and https://github.com/bundler/bundler/commit/0ae330ede86905a17bb940b686d45e19b79f7e41).\r\n\r\nThoughts?"}}
{"actor":{"display_login":"adam12"}}