当我的计算机尝试运行bundle install

时间:2017-01-17 22:27:20

标签: ruby terminal permissions bundle

我正在尝试安装Metasploit,其中一个步骤是运行bundle install命令。我在mac osx上的终端上这样做。但是,当我尝试这样做时,会发生这种情况:

Errno::EACCES: Permission denied @ rb_sysopen -
/Users/soldenh/.rvm/gems/ruby-2.4.0/cache/metasploit-payloads-1.2.6.gem
An error occurred while installing metasploit-payloads (1.2.6), and
Bundler cannot continue.
Make sure that `gem install metasploit-payloads -v '1.2.6'` succeeds before
bundling.

当我运行./msfconsole时,它说:

  

您的软件包已锁定到activesupport(4.2.7.1),但该版本已锁定   无法在Gemfile中列出的任何来源中找到。如果   您没有更改源,这意味着activesupport的作者   (4.2.7.1)已将其删除。您需要将捆绑包更新为   尚未删除的不同版本的activesupport(4.2.7.1)   为了安装。

我该如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

按照建议,运行

#! /usr/bin/env python3
import contextlib
import random
import time
import tkinter


def main():
    root = tkinter.Tk()
    frame = Application(root)
    frame.setup_frame('Hello, world!', ' ' * 50)
    frame.grid()
    root.mainloop()


class Application(tkinter.Frame):

    @classmethod
    def main(cls):
        with cls.setup_root('Tkinter Program') as root:
            root.resizable(False, False)
            frame = cls(root)
            frame.setup_frame('Hello, world!', ' ' * 50)
            frame.grid()

    @staticmethod
    @contextlib.contextmanager
    def setup_root(title):
        tkinter.NoDefaultRoot()
        root = tkinter.Tk()
        root.withdraw()
        root.title(title)
        yield root
        root.after_idle(root.deiconify)
        root.mainloop()

    def setup_frame(self, *args):
        self.after_idle(self.__setup, *args)

    def __setup(self, *args):
        time.sleep(5)   # simulate taking a long time
        self.label = tkinter.Label(self, text='{1}{0}{1}'.format(*args))
        self.label.grid()
        self.button = tkinter.Button(
            self,
            text='Raise a KeyboardInterrupt exception.',
            command=lambda: self.throw(KeyboardInterrupt)
        )
        self.button.grid()

    @staticmethod
    def throw(kind):
        raise kind()


if __name__ == '__main__':
    random.choice((main, Application.main))()